Bug Tracker

Opened 12 years ago

Closed 12 years ago

#2314 closed bug (worksforme)

document.getSelection() message from error consol of FF 2.0.0.1x

Reported by: saidbakr Owned by:
Priority: major Milestone: 1.2.4
Component: core Version: 1.2.2
Keywords: getSelection, firefox, bug, compatability Cc:
Blocked by: Blocking:

Description

hi, Deprecated method document.getSelection() called. Please use window.getSelection() instead.

The following is the code that generates the error:

function chkAva(lnk,id){ el = document.getElementById(id).value; if (el == ){ alert('The user id should have a value before check'); return; } av = "Available"; na = "Not Available, choose another one!"

$(document).ready(function(){ $("#"+lnk).before("<img src='imgs/wait.gif' id='waitImg' /> "); $.ajax({url: 'chk_user.php',type:'GET', data: 'Id='+ el, cache: false, dataType: "script", success: function(data, textStatus){

$("#waitImg").remove()

if (data == 0){

if (document.getElementById('av') == null){ $("#"+lnk).after(" <span id='av' class='hint'> "+av+"</span>"); } else{

$("#av").empty(); $("#"+lnk).after(" <span id='av' class='hint'> "+av+"</span>");

}

} else{

if (document.getElementById('av') != null){

$("#av").empty();

} $("#"+lnk).after(" <span id='av' class='hint'> "+na+"</span>"); }

}, error: function(x,txt,err){ $("#waitImg").remove(); alert('Could not check...'+"\n"+'The server may down or busy. Retry again after a while.'); }

}); });

the html: <form method="post" id="form2">

<table cellpadding="2" cellspacing="0" class="KT_tngtable">

<tr>

<td class="KT_th"><label for="userId">User ID</label></td> <td><input type="text" name="userId" id="userId" size="32" />

<a id="chk1" href="javascript:chkAva('chk1','userId')">check</a> </td>

</tr> <tr>....

Attachments (2)

register.php (14.0 KB) - added by saidbakr 12 years ago.
The file that contains the code
main_js.js (614 bytes) - added by saidbakr 12 years ago.
the remaing linked js file

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by saidbakr

Attachment: register.php added

The file that contains the code

comment:1 Changed 12 years ago by davidserduke

need: PatchTest Case

I'm not aware of jquery using the method getSelection() at all and doing a search of jquery.js didn't show anything either. You are including half a dozen javascript files. Do you have some reason to believe jquery is the culprit?

If you do have such a reason I think you'll need to post a link to a working copy of your test case. I can't figure out what the problem is with the information you've provided so far.

comment:2 in reply to:  1 Changed 12 years ago by saidbakr

Hi, I removed any linked scripts namely: <script src="../includes/common/js/base.js" type="text/javascript"></script> <script src="../includes/common/js/utility.js" type="text/javascript"></script> <script src="../includes/skins/style.js" type="text/javascript"></script> but I kept <script language="javascript" src="scripts/main_js.js" type="text/javascript"></script> it is very simple and does not have any getSelection Again FF error console report the same message. the message appears onload and also when the function chkAva() is invoked.

The script works fine with MSIE. Finally, I think it may be a bug in FF this approach may be abroved when I disabled all plug-ins and add on in FF including web developers tools, the message does not be displayed by the error console, however, the chkAva() function does not able running the portion inwhich Jquery used. Replying to davidserduke:

I'm not aware of jquery using the method getSelection() at all and doing a search of jquery.js didn't show anything either. You are including half a dozen javascript files. Do you have some reason to believe jquery is the culprit?

If you do have such a reason I think you'll need to post a link to a working copy of your test case. I can't figure out what the problem is with the information you've provided so far.

Changed 12 years ago by saidbakr

Attachment: main_js.js added

the remaing linked js file

comment:3 in reply to:  description Changed 12 years ago by nopuck4you

I just had the same error message which did not appear this morning nor yesterday. I realized I installed a new toolbar into Firefox from johnq.com. This toolbar was the culprit. After disabling the toolbar the error went away. Toolbar is at: http://www.johnq.com/ (Streaming TV shows web site - work and family safe as long as you don't go into the "after hours" section)

This should hopefully give you guys a test scenario of an extenal entity interfering with the code functionality.

  • Dmitryw

comment:4 Changed 12 years ago by davidserduke

Milestone: 1.2.31.2.4
Resolution: worksforme
Status: newclosed

I was unable to reproduce the error just using jquery so I'm going to go with Dmitryw's idea that it is a plugin in FF. If that proves not to be the case go ahead and reopen the ticket with a test case where this happens on a clean install of firefox.

Note: See TracTickets for help on using tickets.