Page 1 of 1

convert this javascript code to jquery - help!

Posted: Fri Mar 02, 2012 10:32 pm
by TeeGee
hello, i have this code..


[syntax=javascript]<script language='Javascript' type='text/javascript'>
function RefreshMessage()
{
msg=document.getElementsByName("cboxmain")[0];
msg.src=msg.src;
setTimeout("RefreshMessage()",7000);
}
</script>

<script type='text/javascript'>
window.onload=RefreshMessage();
</script>[/syntax]

i have an iframe "http://www5.cbox.ws/box/?boxid=696909&boxtag=qpnlws&sec=main" with a name "cboxmain".

[syntax=php]<iframe frameborder="0" width="488" height="455" src="http://www5.cbox.ws/box/?boxid=696909&boxtag=qpnlws&sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 1px solid;" id="cboxmain"></iframe>[/syntax]

what basically it does is it refreshes the content inside my iframe every 7 seconds. the content in iframe is blinking..
what i want is the the jquery, so i can put effect like Fade Out/ FadeIn, please help me with this one..

thank you!

Re: convert this javascript code to jquery - help!

Posted: Sat Mar 03, 2012 1:26 am
by jacek
jQuery is JavaScript ! There is nothing to convert, it's the same language.

Re: convert this javascript code to jquery - help!

Posted: Sat Mar 03, 2012 9:35 am
by bowersbros
You can mix the two together, so fadeIn can be mixed with pure javascript. Since its just a library of prewritten javascript as a function, there is nothing wrong with doing that.