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

html embedded in an attribute creates exception at template creation in IE ver 6-8. #18

Closed
benkank opened this issue Oct 29, 2010 · 2 comments

Comments

@benkank
Copy link

benkank commented Oct 29, 2010

I'm using the qtip plugin which can make use of html stored in an attribute to generate a tooltip. I converted a chunk of code to use templates some of which contain html in the alt attribute. Below is an example:

This construction creates errors when a template is generated in all major browsers specifically:

'nodes' is null or not an object' at line 431.

Some combinations of html don't produce outright errors but do cause rendering problems. Escaping the html clears up the problem in all browsers except IE. The only solution that works cross browser is to remove all characters that could be construed as html. At a minimum I would expect that escaped html contained in attributes should be tempatable across all browsers.

@BorisMoore
Copy link
Owner

Can you provide a bit more context for repro of this problem. I run the following in IE8 and the attribute is in the rendered template instance, with the content preserved in the attribute, and no error on line 431:

<script id="template1" type="text/x-jquery-tmpl">
    <span data-foo="<test>">content</span>
</script>

<script type="text/javascript">
    $(function () {
        $("#template1").tmpl().appendTo("#results");
    });
</script>

We need to distinguish between bugs in the jQuery templates code, and problems in browsers that are not anything to do with templates...

@benkank
Copy link
Author

benkank commented Nov 20, 2010

The following used within a template produces an error in all versions of IE.

<div class="help" alt="`<`p`><`b`>`Usage:`<`/b`>` Blah Blah Blah `<`/p`>`" ></div>

This used in template produces an error in all browsers.

<div class="help" alt="<p><b>Usage:</b> Blah Blah Blah</p>" ></div>

This issue was closed.
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