Bug Tracker

Ticket #6239 (closed bug)

Opened 5 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

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

Change History

Changed 5 years ago by Dark-Ape

Sample code example of the problem

comment:1 Changed 4 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 follow-up: ↓ 3 Changed 4 years ago by addyosmani

  • Owner set to Dark-Ape
  • Priority set to undecided
  • Status changed from new to pending

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 4 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 4 years ago by trac-o-bot

  • Status changed from pending to closed

Automatically closed due to 14 days of inactivity.

comment:5 Changed 4 years ago by Dark-Ape

Why was this closed? I realize that I forgot to login to post my response (after already posting it), but still unsure as why this was closed when still unresolved.

Last edited 4 years ago by Dark-Ape (previous) (diff)

comment:6 Changed 4 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 4 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 4 years ago by Dark-Ape (previous) (diff)

comment:8 Changed 4 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 its 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?

Version 0, edited 4 years ago by ajpiano (next)

comment:9 Changed 4 years ago by Dark-Ape

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

comment:10 Changed 4 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 4 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 3 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.