Side navigation
#2314 closed bug (worksforme)
Opened February 09, 2008 09:04PM UTC
Closed May 09, 2008 03:14AM UTC
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)
Change History (4)
Changed February 09, 2008 10:28PM UTC by comment:1
need: | Patch → Test Case |
---|
Changed February 10, 2008 02:24AM UTC by comment:2
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 [comment:1 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 May 09, 2008 12:09AM UTC by comment:3
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 May 09, 2008 03:14AM UTC by comment:4
milestone: | 1.2.3 → 1.2.4 |
---|---|
resolution: | → worksforme |
status: | new → closed |
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.
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.