jQuery: The Write Less, Do More JavaScript Library

Ticket #2314 (closed bug: worksforme)

Opened 3 months ago

Last modified 3 days ago

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

Reported by: saidbakr Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.4 Component: core
Version: 1.2.2 Keywords: getSelection, firefox, bug, compatability
Cc: Needs: Test Case

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

register.php (14.0 kB) - added by saidbakr 3 months ago.
The file that contains the code
main_js.js (0.6 kB) - added by saidbakr 3 months ago.
the remaing linked js file

Change History

Changed 3 months ago by saidbakr

The file that contains the code

follow-up: ↓ 2   Changed 3 months ago by davidserduke

  • need changed from Patch to Test 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.

in reply to: ↑ 1   Changed 3 months 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 3 months ago by saidbakr

the remaing linked js file

in reply to: ↑ description   Changed 3 days 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

  Changed 3 days ago by davidserduke

  • status changed from new to closed
  • resolution set to worksforme
  • milestone changed from 1.2.3 to 1.2.4

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.