Bug Tracker

Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#6239 closed bug

Error on tag selection

Reported by: Dark-Ape Owned by: Dark-Ape
Priority: undecided Milestone: 1.4.3
Component: selector Version: 1.4.2
Keywords: custom tag, selector Cc:
Blocked by: Blocking:

Description

I wrote a script for custom tags to be replaced with externally generated content and it works fine in everything by IE. When debugging the problem, both IE7 & IE8 say the error is occuring in the jQuery JS file, not the code. I originally wrote this for 1.3.2, but the same thing is occuring when using 1.4.2. I've attached the code I am using to this ticket.

Attachments (1)

jquery_custom_tag.html (965 bytes) - added by Dark-Ape 14 years ago.
Sample code example of the problem

Download all attachments as: .zip

Change History (13)

Changed 14 years ago by Dark-Ape

Attachment: jquery_custom_tag.html added

Sample code example of the problem

comment:1 Changed 13 years ago by Dark-Ape

Has anyone found a viable solution or even been able to track how/why this error occurs? I have been looking myself without success. ><

comment:2 Changed 13 years ago by addyosmani

Owner: set to Dark-Ape
Priority: undecided
Status: newpending

Was your code able to run fine using 1.3.2 or is is broken across all versions of jQuery?

comment:3 in reply to:  2 Changed 13 years ago by anonymous

jsFiddle: http://jsfiddle.net/aUF3z/1/

The result in jsFiddle's result isn't the completed version, since I failed to find an external file reference in the API, but IE does not even replace the tags with the loading image that appears in jsFiddle.

I have run this code using both 1.3.2 and 1.4.2 and neither version works in IE8, yet work fine in both jQuery versions for Firefox and Chrome. I no longer have a version of IE7 to work with, but the compatibility viewer says it is still broken.


jQuery 1.4.2 "Webpage error details" from IE:

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C) Timestamp: Fri, 15 Oct 2010 15:39:00 UTC

Message: Unexpected call to method or property access. Line: 103 Char: 460 Code: 0 URI: http://www.hacres.com/js/jquery-1.4.2.min.js


jQuery 1.3.2 "Webpage error details" from IE:

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C) Timestamp: Fri, 15 Oct 2010 15:40:07 UTC

Message: Unexpected call to method or property access. Line: 12 Char: 2305 Code: 0 URI: http://www.hacres.com/js/jquery-1.3.2.min.js


Replying to addyosmani:

Was your code able to run fine using 1.3.2 or is is broken across all versions of jQuery?

comment:4 Changed 13 years ago by trac-o-bot

Status: pendingclosed

Automatically closed due to 14 days of inactivity.

comment:5 Changed 13 years ago by Dark-Ape

Why was this closed?!

Version 0, edited 13 years ago by Dark-Ape (next)

comment:6 Changed 13 years ago by ajpiano

It was closed due to inactivity. There's no real evidence there is a jQuery bug in play here, rather something that this custom tags script is doing improperly. If you are indeed creating custom elements on the fly, jQuery does not support this behaviour out of the box, even if it does kinda-sorta work in non-IE browsers.

If you can actually provide a simple test that shows what the plugin is doing, not the code you're using to invoke the plugin, we can maybe take a look.

comment:7 Changed 13 years ago by Dark-Ape

The call for the event listing for God's Way to Ultimate Health on http://www.hacres.com/education/on-the-road:

<jtag limit="10" key="128" type="onTheRoad"></jtag>

I'm using the custom "jtag" tag as an easy selector...

  1. We're updated all of those tags with actual HTML in case the load fails.
  2. Processing each jtag one at a time, we're post-pending every attribute with content on that tag to the .load's url.
  3. The .load's page is using those attributes to grab database entries and return formated HTML.
  4. On success, replace the jtag entirely with the .load's response.
Last edited 13 years ago by Dark-Ape (previous) (diff)

comment:8 Changed 13 years ago by ajpiano

Non-standard elements cannot be created on the fly using JavaScript in IE unless they are "shived" using a technique like http://jdbartlett.github.com/innershiv/ or https://gist.github.com/5ebafd3bad9f131fe95b. This technique, for instance, is used for allowing HTML5 elements to work in IE.

This is not a jQuery bug, but rather a question of support. Will jQuery support auto-shiving nonexistent elements? Seeing as it's something of a corner case, probably not, more the job for a plugin. Therefore, this ticket is probably going to remain closed.... to clarify though, has this plugin *ever* worked in IE?

Last edited 13 years ago by ajpiano (previous) (diff)

comment:9 Changed 13 years ago by Dark-Ape

Not to my knowledge; I only wrote it when 1.3.2 was already out.

comment:10 Changed 13 years ago by ajpiano

In that case it is definitely not a jQuery bug, but rather a design flaw. What you're trying to do cannot be done in IE without resorting to expensive hacks that we cannot afford to integrate into jQuery Core. Sorry for any confusion, thanks for your time.

comment:11 Changed 13 years ago by anonymous

In case someone else stumbles upon this thread via Google... I had the exact same error and finally found that the offending line was trying to set the title using:

$('title').text("some title");

I changed the method (and added a bit more safety) and have no more problems with:

try{

document.title = "some title";

} catch(err) { }

comment:12 Changed 12 years ago by Dark-Ape

Yep, IE just didn't like trying to select an unknown tag, so I just changed all of my jTag tags into divs that had the class of jTag, updated the selector and then it worked.

Note: See TracTickets for help on using tickets.