1.

Solve : iframe help?

Answer»

I am having problem with my iframe. It seems thaI have to post the iframe twice to make it work, I want to post it only once not twice, there an error in the code and im not sure were its located. I have LISTED the code below:
I think its in the if, or else if, tried it with out, ans still have to post it twice to work.


var locate = window.location
if (locate == "http://www.suproduction.com/weather.html?web=weather")
document.write('http://www.weather.com" height="100%" width="100%">');

else if (locate == "http://suproduction.com/weather.html?web=weather")
document.write('http://www.weather.com" height="100%" width="100%">');


What can I do with the code so that I can enter it once and have it work!!
Thanks

Try using braces:

if ( ... )
{
do something;
} else if ( ... ) {
do something else;
}ok I will try that!!!ok the braces did not work, this is what I did per above request

}
else if (locate == "http://suproduction.com/weather.html?web=weather")
document.write('http://www.weather.com" height="100%" width="100%">');
}

did not work, still have to post this code twice to work , any more ideas, please use the code above to show the correct way to make this work, thanks for your help!!!
MikeHmm... I was only LOOKING at your programming logic. Can you give me a LINK to the page so I can debug it? Your code should BASICALLY be:


if (locate == "http://suproduction.com/weather.html?web=weather")
{
document.write('http://www.weather.com" height="100%" width="100%">');
}
thanks I will try that code!!!!Hey thanks thoses braces worked, your awsome
another question same topic:
I do all my coding in EXPLORE and notepad, but when I upload it to my website the code does not work intill I change the root dir, its there a simple way to make this work both on my c:/ and when I upload it, down below is an example:

var locate = window.location
if (locate == "file:///C:/suproduction/hurr/temp.html?web=aa")
{
document.write('http://www.weather.com" height="100%" width="100%">');
}


but when I upload it to my space I have to change the code to this:


var locate = window.location
if (locate == "http://suproduction/hurr/temp.html?web=aa")
{
document.write('http://www.weather.com" height="100%" width="100%">');
}


so is there a simple way of doing this with out having to chage the code dir.
Thanks



Discussion

No Comment Found