• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jQuery question- jQuery attribute in IE?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm working on an application which includes a text editor, and jQuery has been really useful for me so far. However, I just noticed something which might be a problem for my app. I provide a button for users to display the page's html, and it looks like jQuery appends its own attribute to referenced elements. I'm testing on IE7 and Firefox 3, and this only happens in IE. Given the following simple html, the alert displays this text-
in IE: <INPUT id=button1 type=button value="Click here to see HTML" jQuery1249910571515="2">
in FF: <INPUT id=button1 type=button value="Click here to see HTML" >

Any ideas?

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They do that for memory leak protection. You can strip it out.



Eric
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So? What's the problem this is causing?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:So? What's the problem this is causing?



Amy does not want the person copying the code to have unnecessary attributes in the markup.

Amy,
If you are letting them edit it there as an HTML view, you need to keep those attributes there or your code is not going to work so well.

Eric
 
Amy Crowley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your replies. There is no functional problem caused by the jQueryDDDD attribute being there; the only problem is probable user confusion on seeing those extra jQuery attributes upon viewing the HTML source. Also, yes, I should have mentioned that users can edit the html source view; my application is really just a plugin for FCKEditor (open source text editor).

I'll test the suggestion to strip the jQueryDDDD attribute to see if it causes any problems when switching back and forth between HTML/Design views. Thanks again-
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you remove those references, I have a feeling JQuery will stop working.

Eric
 
Amy Crowley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just got a chance to test this today. I used your suggestion to do a replace with regex to strip all jquerydddd attributes, and it worked like a charm. Also doesn't seem to cause any subsequent referencing issues. I do the replace each time user toggles to view html source.

Since it was mentioned that this attribute may be used for memory leak protection/cleanup, I'll do some further testing to see if IE memory usage seems affected by the change. If so, I'll post the findings.

Thanks much for your help.
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eric, care to elaborate on how the memory leak protection that you talked about (those identifiers) works? any links?
reply
    Bookmark Topic Watch Topic
  • New Topic