The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

code not working

4 posters

Go down

Solved code not working

Post by 10564 February 7th 2010, 10:27 am

supposedly this code is supposed to auto-refresh every 10 seconds. The first part shows what track is playing on my online radio show while the 2nd part shows whether the radio is online or not. Everything involved is on the homepage of my forum. The code works, but I tried modifying it so it would auto-refresh, but it didn't work. Can someone who's good with code help me out?

<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
function refreshme(){
window.location='http://www.yourpage.com/index.html#bottom';
}
setTimeout("refreshme()",10000);

</script>
<br><br>
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
function refreshme(){
window.location='http://www.yourpage.com/index.html#bottom';
}
setTimeout("refreshme()",10000);
</script>
avatar
10564
Forumember

Posts : 48
Reputation : 0
Language : english

Back to top Go down

Solved Re: code not working

Post by ankillien February 7th 2010, 10:41 am

Hello,

I tried the script on a test page and it works fine for me. It should work for you too.

Where exactly you are putting the code? and what happens?
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Solved Re: code not working

Post by 10564 February 7th 2010, 10:52 am

I'm putting it in the homepage message content section. I have other code there that works fine. This code works but does not refresh every 10 seconds like I would like it to.
avatar
10564
Forumember

Posts : 48
Reputation : 0
Language : english

Back to top Go down

Solved Re: code not working

Post by Jake Blues February 7th 2010, 11:07 am

I'll make it easy for u, replace the current refresh code with this:
Code:

<META
http-equiv="refresh"
content="10"; URL="http://harshnoise.forumotion.com/index.htm/">
Jake Blues
Jake Blues
Forumember

Posts : 102
Reputation : 0
Language : English

http://phoenix-etclan.com

Back to top Go down

Solved Re: code not working

Post by 10564 February 7th 2010, 11:15 am

when I put that in my forum freaked out and now nothing other than the chatbox is showing up D:

current code:

<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
<META
http-equiv="refresh"
content="10"; URL="http://harshnoise.forumotion.com/index.htm/">

</script>
<br><br>
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
<META
http-equiv="refresh"
content="10"; URL="http://harshnoise.forumotion.com/index.htm/">
</div>
avatar
10564
Forumember

Posts : 48
Reputation : 0
Language : english

Back to top Go down

Solved Re: code not working

Post by ankillien February 7th 2010, 11:17 am

Ok, I see the refresh code was not properly added.
You can use this code...

Code:
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
</script>

<br><br>

<script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
</script>
<script type=text/javascript>
setTimeout(' document.location=document.location' ,10000);
</script>

EDIT :

The <meta> tag must go inside the <head> tags otherwise it will not work properly.
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Solved Re: code not working

Post by Jake Blues February 7th 2010, 11:20 am

The code I just gave u just put it in there once and put it at the top of all the other code.

The other thing is it will refresh the whole page, are u only wanting the media player to refresh?
Jake Blues
Jake Blues
Forumember

Posts : 102
Reputation : 0
Language : English

http://phoenix-etclan.com

Back to top Go down

Solved Re: code not working

Post by 10564 February 7th 2010, 11:27 am

Ankillien, I'm not sure what you're wanting me to do D:

And Jake, I only want this code to refresh:

<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
</script>

<script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
</script>

my current code is this:


<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
<META
http-equiv="refresh"
content="10"; URL="http://harshnoise.forumotion.com/index.htm/">

</script>
<br><br>
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
<META
http-equiv="refresh"
content="10"; URL="http://harshnoise.forumotion.com/index.htm/">
</script>
</div>
avatar
10564
Forumember

Posts : 48
Reputation : 0
Language : english

Back to top Go down

Solved Re: code not working

Post by ankillien February 7th 2010, 11:29 am

I am just asking you to try use my code instead of the one you are using currently.

It will refresh the page every 10 seconds, isn't that what you want?
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Solved Re: code not working

Post by 10564 February 7th 2010, 11:34 am

Ankillien, that code refreshes the entire page, I just want wanted this code to refresh every 10 seconds:

<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
</script>

<br><br>
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
</script>
avatar
10564
Forumember

Posts : 48
Reputation : 0
Language : english

Back to top Go down

Solved Re: code not working

Post by Jake Blues February 7th 2010, 11:43 am

Dude can u post all of ur homepage message code, idk if I will get to it straight away but I have an idea of how to get it to work or maybe ankillien can get to it right away
Jake Blues
Jake Blues
Forumember

Posts : 102
Reputation : 0
Language : English

http://phoenix-etclan.com

Back to top Go down

Solved Re: code not working

Post by 10564 February 7th 2010, 11:44 am

alright, here it is:

<div align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width=728 height=486 id=chat align=middle>
<param name="allowScriptAccess" value="sameDomain" />

<param name=movie value=http://www.xatech.com/web_gear/chat/chat.swf /><param name=quality value=high /><param name=bgcolor value=#000000 />
<param name=FlashVars value="id=83986081&pass=28696362" />
<embed src=http://www.xatech.com/web_gear/chat/chat.swf quality=high bgcolor=#ffffff width=728 height=486 name=chat FlashVars="id=83986081&pass=28696362" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.xat.com/update_flash.shtml" /></object>
</p><div align="center" style="border: 0; padding-top: 20px;"><div id="player" style="width: 240px; height: 60px; border: 0;">
<br>

<script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
</script>
<br><br>
<script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
</script>
<script type=text/javascript>
setTimeout(' document.location=document.location' ,10000);
</script>
<br><br>
<a href="http://s4.myradiostream.com/19112.htm">Listen here</a>
<br><br>
<!-- You may edit the code below, this is just an example of how to link to your stream. -->
<p><div align="center" style="border: 0; padding-top: 20px;"><div id="player" style="width: 240px; height: 60px; border: 0;">
<div id="playerswf" style="display:inline-block; padding: 0; width: 240px; height: 60px; background-image:url('http://bellonline.co.uk/player/player.png'); border: 0;">
<object width="240" height="60">

<param name="movie" value="http://bellonline.co.uk/player/player.swf?url=http%3A%2F%2Fs4.myradiostream.com%3A19112/;&autoplay=1&title=HARSH NOISE " />
<param name="wmode" value="transparent" />
<embed src="http://bellonline.co.uk/player/player.swf?url=http%3A%2F%2Fs4.myradiostream.com%3A19112/;&autoplay=1&title=HARSH NOISE " width="240" height="60" wmode="transparent" type="application/x-shockwave-flash" />
</object>
</div>
</div>
</div>
</div>
</div>
avatar
10564
Forumember

Posts : 48
Reputation : 0
Language : english

Back to top Go down

Solved Re: code not working

Post by ankillien February 7th 2010, 1:12 pm

To refresh only the code is not possible since it requires some AJAX scripting. It usually requires access to some PHP files or the database so we can't do it.

All we can do is auto-refresh the page using JavaScript.
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

Solved Re: code not working

Post by RoNo February 7th 2010, 2:19 pm

Hey guys... WaZaAp?! Cool

10564, an Iframe will do the trick... *demo
(notice the content refreshing under your chatbox)

Create an Html page with your auto-refresh script...
(use forum header and footer? "no")
Code:
<center><script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
</script> <script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
</script>
<script type=text/javascript>
setTimeout(' document.location=document.location' ,10000);
</script></center>

Copy the page Url from "Html pages management", add it to an
Iframe & position it after the chatbox (on your chat-music page)
Code:
<iframe src=http://Your New Script Page.htm marginheight=0 marginwidth=0 frameborder=0 height=100% width=100%  scrolling=no></iframe>

Here is the entire code I used for the demo...
(you'll need to customize the page/add a background etc)
Code:
<body bgcolor="lightblue"><div align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width=728 height=486 id=chat align=middle>
<param name="allowScriptAccess" value="sameDomain" />

<param name=movie value=http://www.xatech.com/web_gear/chat/chat.swf /><param name=quality value=high /><param name=bgcolor value=#000000 />
<param name=FlashVars value="id=83986081&pass=28696362" />
<embed src=http://www.xatech.com/web_gear/chat/chat.swf quality=high bgcolor=#ffffff width=728 height=486 name=chat FlashVars="id=83986081&pass=28696362" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.xat.com/update_flash.shtml" /></object>
</p><div align="center" style="border: 0; padding-top: 20px;"><div id="player" style="width: 240px; height: 60px; border: 0;">
<br>

<iframe src=http://zone3.forumotion.com/Test-Refresh-h101.htm marginheight=0 marginwidth=0 frameborder=0 height=100% width=100%  scrolling=no></iframe>

<a href="http://s4.myradiostream.com/19112.htm">Listen here</a>
<br><br>
<!-- You may edit the code below, this is just an example of how to link to your stream. -->
<p><div align="center" style="border: 0; padding-top: 20px;"><div id="player" style="width: 240px; height: 60px; border: 0;"><div id="playerswf" style="display:inline-block; padding: 0; width: 240px; height: 60px; background-image:url('http://bellonline.co.uk/player/player.png'); border: 0;">
<object width="240" height="60">

<param name="movie" value="http://bellonline.co.uk/player/player.swf?url=http%3A%2F%2Fs4.myradiostream.com%3A19112/;&autoplay=1&title=HARSH NOISE " />
<param name="wmode" value="transparent" />
<embed src="http://bellonline.co.uk/player/player.swf?url=http%3A%2F%2Fs4.myradiostream.com%3A19112/;&autoplay=1&title=HARSH NOISE " width="240" height="60" wmode="transparent" type="application/x-shockwave-flash" />
</object>
</div>
</div>
RoNo
RoNo
Active Poster

Male Posts : 1270
Reputation : 135
Language : English
Location : Laguna Beach, California

http://bf2mercenaries.forumotion.com/

Back to top Go down

Solved Re: code not working

Post by 10564 February 7th 2010, 11:49 pm

RoNo, that works excellently Very Happy

THANK YOU SOOOOOOOOOO MUCH Very Happy Very Happy Very Happy

:wouhou: :wouhou: :wouhou: Very good Very good Very good cheers cheers cheers thumleft thumright
avatar
10564
Forumember

Posts : 48
Reputation : 0
Language : english

Back to top Go down

Solved Re: code not working

Post by RoNo February 8th 2010, 12:00 am

You can give it bold color like this
Code:
<center><b><font color="orange"><script type="text/javascript" src="http://shoutcast.mixstream.net/js/song/uk4-free:19112">
You appear to have javascript turned off.
</script> <script type="text/javascript" src="http://shoutcast.mixstream.net/js/status/uk4-free:19112">
You appear to have javascript turned off.
</script>
<script type=text/javascript>
setTimeout(' document.location=document.location' ,10000);
</script></font></b></center>

code not working Cool2

This topic is solved. Glad I could help.

Lockedcode not working Lock2RoNo
RoNo
RoNo
Active Poster

Male Posts : 1270
Reputation : 135
Language : English
Location : Laguna Beach, California

http://bf2mercenaries.forumotion.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum