<? help
- Started
- Last post
- 11 Responses
- meffid
I need to refresh a page via a link with php.
<input type="button" value="Reload page" onclick="reloadPage()" />
and in the header:
<script type="text/javascript">
function reloadPage()
{
window.location.reload()
}
</script>How do I just make it an <a> and what's the syntax to wrap it?
- meffid0
<a href="#" onclick="reloadPage()">I don't fucking like this</a>
Must be a way to re-run my script in a div without refreshing the whole page though.
- orrinward0
jQuery, AJAX?
- plash0
ajax baby,
http://rajshekhar.net/blog/archi…
- meffid0
^ Looks simple, I'm no dev though.
Wanna take a quick look plash?
- http://pastebin.com/…plash
- I don't get the pastebin site, plash; check your mail.meffid
- vaxorcist0
you could kludge it up with an iframe
- plash0
anxious to push your project files on me huh.. ;)
ill post it up for you; so other people can chime in.http://pastebin.com/8MtaJwbH [ index.php ]
http://pastebin.com/kxVQ6gZ9 [ video.php ]
http://pastebin.com/VRrFjmAL [ styles.php ]http://localhostr.com/file/IHgFx… [ source files]
pastebin is a cut-paste/ snippet depository. stores alphanumeric data, supports code highlighting and link sharing. so you dont have to send unsolicited emails with zip file attachments.
localhostr is a file host with link sharing. so you can put a file online and allow multiple people access with one source.
unrelated quote.
- " I'll smoke it with you, bro. We'll go to the loony bin together. I don't give a fuck!" - Dante, Grandma's Boy, 2006
- TResudek0
Am I missing something? Why would you need PHP to refresh an entire page? How about a hash mark as the href or a js function that returns true?
- plash0
you can also use any of the compressive javascript frameworks.
http://en.wikipedia.org/wiki/Com…
- meffid0
The site is:
www.ineedsomenewfuckingmusic.com…
The files are where plash pasted them, if you can help by adding a page refresh or js div refresh once the video has completed too, that'd be great.
- plash0
what are you trying to get us to do?
if i understand correctly; you want the reload the index.php once the youtube video completes a full play-through? (essentially picking the next random video)or are you trying to add a page refresh once the video has completed loading? .. (wouldn't that just re-buffer the stream?)
or are you trying to load the next video once a full playback occurs?
(implementing playlist 'like' feature) which explains why you have a video.php file. & from the looks of it, you are loading youtube url ids, placing them into an array and then randomly picking from your playlist array. am i close?just an idea but couldn't you just embed a youtube playlist?
the youtube api is pretty powerful. http://code.google.com/apis/yout…
- meffid0
^ Nice links, thanks.
I did think of a playlist - that'd also be easier to manage.