I have created a page using some AJAX to call the embed video streaming. By every click on the image it will show the embed of that channel I use <li><a href="#" onClick="showtv('30')">
Before I use PHP; so if I enter the web site what I use to have is the echo
which in that case I use to use the else
option to make the default option to one of the channel I set it up so it will auto play one of the channels right away.
So come to my question in the case of PHP if the default in the else
was one of my channels that will show on the first index page when my visitors enter the site.
With AJAX nothing shows unless you click on of the channel where the onClick
is,
and every time you click on any of the AJAX items it will just have the #
sign but with PHP I can set something like ?showtv=30
. I want to know if with AJAX also can be possibly done the same way?
I'm just curious because I wish to make a Twitter and Facebook share button for each of the channel but if with only #
on AJAX it will never link to the channel people wish to share.
/I hope that my question didn't confuse you, if so I can give a better explanation [if required]\
EDIT"""
An example of what I have for the AJAX right now is in this page http://tv.yoursn0w.com but each of the click on the channel it will just be like http://tv.yoursn0w.com/# and can't go directly to specific channel.
With the PHP use I can make something like http://tv.yoursn0w.com/?channel=sports and it will bring me to sport channel directly.
I feel hesitant to answer this question since I don't really get what you're asking, but I gather that you wonder if hash tags can be used the same way in JavaScript as query tags in PHP. And the answer to that is yes. In fact, that's exactly what's being answered here
Retrieve specific hash tag's value from url
Edit
If you want to be informed when the hash part of the URL changes, check out the "hashchange" event. Described here