Extracting query string info onMouseover and displaying information...

D

detho

Hi everyone...
I am currently developing a streaming movie front-end for my companies'
intranet.
The script is done with PHP on the back-end and HTML and CSS for the
front-end.

Basically, the script displays the available videos in a list of links
and when the user clicks on the video, the script grabs the query
string information and concatinates the appropriate filename into a
variable which is used to start Windows Media Player.
This system works beautifully and everything was great until my boss
said to me "It'd be nice if we could have popup descriptions when the
user puts his/her mouse over the link."

So.
I need some code that will pull the filename out of the query string on
mouse over, then open a text file (on the web server) with that same
filename and echo it to the browser.

I know this system is begging for a database, but I'm trying to keep
this managable by my coworkers who aren't programmers and don't know
how to manipulate SQL.
 
H

Hoss

function ixParseURL(url)
{
var parse = function(x)
{
var paramArray = new Array();

var regex = /(?:\?|&)[a-z0-9]+=[^=&?]+/gi;
var splitter = /([^=?&]+)=([^=]+)/;

var results = regex.exec(x);
while(results != null)
{
var param = splitter.exec(results[0]);
paramArray[param[1].toLowerCase()] = param[2];

results = regex.exec(x);
}
return paramArray;
}
if(url)
{
return parse(url);
}
else
{
if(ixParseURL_cache)
{
var ret = ixParseURL_cache;
if(document.location.hash.length != 0)
{
ret["hash"] = document.location.hash.slice(1,
document.location.hash.length);
}
return ret;
}
var ret = parse(document.location.search);
ixParseURL_cache = ret;
if(document.location.hash.length != 0)
ret["hash"] = document.location.hash.slice(1,
document.location.hash.length);
}
return ret;
}

You can use the preceeding method to parse the URL and get your
filename out. As far as opening a file on the web server and doing a
popup, youll need to make an Ajax request to do that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top