I am trying to identify an HTML element by using GUID from an item in a database.
I have a GUID from SQL that I am using in HTML as a unique ID for a tag. For the most part it works, as long as I do not try to use it with jQUery. The code looks like this:
var thisID = '#lesson' + string (this .model.attributes.ID); Warning (thisID); $ (ThisID) FadeTo ('slow', 0.5); The alert works just fine, but jQuery causes this error:
Unicode error: syntax error, unrecognized expression: #lesson {35E87357-1251 -4C68-A1B2-8F83A4B3E0E9} What's weird, if I remove the brackets from the GUID (e.g., after the initial SQL call), the string looks like this : # Texton 35E 87357-1251-4C68-A1B2-8F83A4B3EE9E ... then it works but I'm brave Not Htaunga. Apart from this, it does not seem like a case where I connect the string. Any ideas how can I fix this? "post-text" itemprop = "text">
Curly bracing means that you are defining an object in javascript. You need to avoid them from \\ so that they can experiment with jQuery.
No comments:
Post a Comment