Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#7765 closed bug (invalid)

jQuery IE8 error on <a onclick>

Reported by: anonymous Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

I'm using simple ajax to load data from server with php and passing it thru selector.load() jQuery function. when using firefox or other browser, the script went well and the needed function is run smoothly. but when i use IE (6,7,8) it shows error script and the page is not working.

this is the script that i use;

<a onclick='javascript:dlg('var1'.'var2');'>blabla</a>

where dlg is some jquery function

is <a onclick=> is not working on IE? how to resolve it? im using jquery 1.4.4, thanks.

Change History (2)

comment:1 Changed 12 years ago by anonymous

This is the function that I use

function dlg(artid,artrev) {
        var scrollable = jQuery("#itemdetail_dialog");
        scrollable.empty();
        var loading = jQuery('<div class="loading"><img src="imgs/apps/ajax.gif" width="16px" Height="16px" /><br /><br />Loading...</div>').appendTo(scrollable);
        var a = scrollable.load("libs/php/getitemdetail.php?info="+artid+"&rev="+artrev+"");
        if (a != "") {
            loading.hide();
            scrollable.dialog('open');
        }

and this is the ajax content

echo "<a title='$rowp[1]' onclick='javascript:dlg(%26apos;var1%26apos;,%26apos;var2%26apos;);'>";
$content = CutString(html2txt($rowp[11]),350);
                                
echo "<div style='display:inline; vertical-align:top;'>";
echo "<div style='float:left; width:70px; margin:5px 0 0 5px;'>";
echo "<img src='imgs/docs/$rowp[12]' width='60px' />";
echo "</div>";
echo "<div style='float:left; margin-left:7px;width:500px'>$content</div>";
echo "<div style='clear:both'></div>";
echo "</div>";
echo "</a>";

comment:2 Changed 12 years ago by Rick Waldron

Resolution: invalid
Status: newclosed

This is not a jQuery bug.

You have a period between your arguments instead of a comma, and "dlg" is not a jQuery function.

<a onclick='javascript:dlg('var1'.'var2');'>blabla</a>
Note: See TracTickets for help on using tickets.