Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Firefox getElementById problem
Old 08-18-2008, 07:20 AM Firefox getElementById problem
Experienced Talker

Posts: 34
Trades: 0
Its kind of simple but doesnt know why firefox giving error about it.

The code is

if((document.getElementById("status").innerHTML.le ngth >0 ) ){
}
which I already have altered the comparison technique but to no avail.

if((document.getElementById("status").innerHTML != "" ) ){
}

if((document.getElementById("status").innerHTML.ma tch("") ) ){
}



Problem with that is ,in firefox it always set this condition true,even the innerHTML have empty string.

status is div ,which is getting its value after onchange effect from ajax function.

Kindly need a solution. Thanks
autumn is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-18-2008, 11:27 AM Re: Firefox getElementById problem
Skilled Talker

Posts: 61
Trades: 0
What does this yield?

divText =
document.getElementById("status").innerHTML;

alert(divText);

if((divText != "" ) ){
alert("a");
}
just_a_pod is offline
Reply With Quote
View Public Profile
 
Old 08-18-2008, 09:26 PM Re: Firefox getElementById problem
Experienced Talker

Posts: 34
Trades: 0
It yields non empty value and will alert a, even if the div in form is blank.

In a static way, the div is blank ,and will only get its value from onchange event. I suppose , that ajax function is setting its value within the process ,without onchange event. The firebug nor error console gives any error. But the problem exists only with firefox.
autumn is offline
Reply With Quote
View Public Profile
 
Old 08-19-2008, 03:50 AM Re: Firefox getElementById problem
Experienced Talker

Posts: 34
Trades: 0
Thanks , issue is resloved.
autumn is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Firefox getElementById problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26937 seconds with 12 queries