Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

element id shorthand doesn't work client side on IE7 #96

Open
hankmander opened this issue Nov 9, 2011 · 3 comments
Open

element id shorthand doesn't work client side on IE7 #96

hankmander opened this issue Nov 9, 2011 · 3 comments

Comments

@hankmander
Copy link

the coffekup code:
div "#my_id", ->
gives:
<DIV class="#my_id">
instead of giving the element an id it gives the element a class that starts with a '#'. However, it works if you do this instead:
div id: "register_interest", ->

giving elements classes ( div ".my_id", -> ) works as expected though.

NOTE. This only occurs when client side rendering a template in Internet explorer 7. Might apply to other versions of IE as well.

Edit: version 0.3.1 of coffeekup and 1.1.2 of coffeescript used

@hankmander
Copy link
Author

Seems like it's the same with current versions of Opera.

@treeform
Copy link

I have the same issue with IE8

@treeform
Copy link

fix here:

@@ -126,10 +126,12 @@ skeleton = (data = {}) ->
       classes = []

       for i in str.split '.'
-        if '#' in i
-          id = i.replace '#', ''
+        if i.length == 0
+          continue
+        if "#" == i[0]
+          id = i.slice 1
         else
-          classes.push i unless i is ''
+          classes.push i

       text " id=\"#{id}\"" if id

I restricted it to hash in the beginning only. Moved empty string check up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants