Bug Tracker

Modify

Ticket #2314 (closed bug: worksforme)

Opened 5 years ago

Last modified 5 years ago

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

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 Download (14.0 KB) - added by saidbakr 5 years ago.
The file that contains the code
main_js.js Download (614 bytes) - added by saidbakr 5 years ago.
the remaing linked js file

Change History

Changed 5 years ago by saidbakr

The file that contains the code

comment:1 follow-up: ↓ 2 Changed 5 years 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.

comment:2 in reply to: ↑ 1 Changed 5 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 5 years ago by saidbakr

the remaing linked js file

comment:3 in reply to: ↑ description Changed 5 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 5 years 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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.