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
Javascript in IE and Safari/FireFox
Old 01-20-2009, 10:44 AM Javascript in IE and Safari/FireFox
Junior Talker

Posts: 2
Trades: 0
Hi,

The following code works only in IE, not in Safari or FireFox.
Can anyone tell me why?
Code:
 
 
function AddDoc() 
{
 var bElementFound = false;
 var onumber = new Number();
 var oname = new String();
 var oprice = new String();
    var tableCellCol = document.getElementsByTagName("Td");
    for(var i = 0; i < tableCellCol.length && !bElementFound; i++)
    {
      var cellElm = tableCellCol(i);
      if(cellElm.className == "ms-formbody")
      {
        onumber++;
    //alert(onumber + " : " + cellElm.innerHTML);
        if(onumber==12)
        {
         oname = cellElm.innerHTML;
         //alert(oname);
        }
        if(onumber==19)
        {
         //alert(oprice);
         oprice = cellElm.innerHTML;
        }
      }
    }
 window.open('http://sp.kobelco.it/Public/Lists/Orders/NewForm.aspx?WineId='+ querySt('ID') + '&ClientId=' + queryForClientId() + '&WineName=' + oname + '&Price=' + oprice ,"_self"); 
}
Thanks,
TobiasVdb is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-20-2009, 11:49 AM Re: Javascript in IE and Safari/FireFox
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
What does it fail on?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-20-2009, 11:51 AM Re: Javascript in IE and Safari/FireFox
Junior Talker

Posts: 2
Trades: 0
Quote:
Originally Posted by chrishirst View Post
What does it fail on?
Don't really know, It just doesn't reach the last line in FF and on Safari.

So the mistake isn't real obvious? I've just started using JS.

Guess I'll start putting alerts in the code?
TobiasVdb is offline
Reply With Quote
View Public Profile
 
Old 01-20-2009, 11:57 AM Re: Javascript in IE and Safari/FireFox
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
So the mistake isn't real obvious?
If we had the rest of the page code to recreate the error, it might well be.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Javascript in IE and Safari/FireFox
 

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.24802 seconds with 12 queries