I give up!

P

Pascal Herczog

Well, I know bugger all about html, and even less about Javascript, but the
following seems like it must surely be possible, only I can't figure it out.
Any answers much appreciated!

I have an html page divided into 2 frames. The left side contains a table
with a series of hyperlinks to select different movie files to be played in
the right hand frame. Now, I could do it the easy (boring!) way, and make
each link call a unique html file that contains the exact same embedded
object definition for the media player, but each with a unique

<param name='fileName' value="Filename1.mpg">

entry to play the correct movie file.

However, it seems to me that, given that it is possible to call this url
with some parameters attached, I must surely be able to create a generic
movieplayer.htm file that uses the ?name=Filename1.mpg parameter to assign
it as the name of the file to be played.

So, my table url would be <a
href="movieplayer.htm?name=Filename1.mpg">Filename1</a>

But, for the life of me, I can't figure out what javascript function or
whatever I need to assign the url parameter to the embedded object parameter
in my movieplayer.htm file.

Help!!!

Ta,
Pascal.
 
J

JDS

But, for the life of me, I can't figure out what javascript function or
whatever I need to assign the url parameter to the embedded object parameter
in my movieplayer.htm file.

You need server-side stuff to make this work. Javascript won't help for
what you describe.

Mind you, the server side stuff for this small task is very, very, very
easy.

How is your server/host configured? Then I can give you tips on how do do
what you want in your specific environment.
 
B

bernhard

Pascal said:
I have an html page divided into 2 frames. The left side contains a table
with a series of hyperlinks to select different movie files to be played in
the right hand frame. Now, I could do it the easy (boring!) way, and make
each link call a unique html file that contains the exact same embedded
object definition for the media player, but each with a unique

<param name='fileName' value="Filename1.mpg">

entry to play the correct movie file.

However, it seems to me that, given that it is possible to call this url
with some parameters attached, I must surely be able to create a generic
movieplayer.htm file that uses the ?name=Filename1.mpg parameter to assign
it as the name of the file to be played.

So, my table url would be <a
href="movieplayer.htm?name=Filename1.mpg">Filename1</a>

This must be done using server side scripting. Check if you can use php
on your server. it takes less than 10 lines of php code to solve your
prob.

bernhard
 
P

Pascal Herczog

bernhard said:
This must be done using server side scripting. Check if you can use php
on your server. it takes less than 10 lines of php code to solve your
prob.

Unfortunately I've no idea whether my ISP, Plusnet, supports php. It might
well do, but I know even less than nothing about that! If you could post the
required code I'll have a go at it though...

I had found a javascript example for a querystring function, that looked
like it ought to do the job. It's code was:

<script type="text/javascript">
<!-- Begin

var qsParm = new Array();
function qs() {
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms.indexOf('=');
if (pos > 0) {
var key = parms.substring(0,pos);
var val = parms.substring(pos+1);
qsParm[key] = val;
}
}
}
qsParm['name'] = null;
qs();
// End -->
</script>

But a) I don't know if this actually works, and b) I can only see how this
might get called from things like 'onclick' like actions, but not for
assigning in the

<param name='fileName' value="Filename1.mpg">

type of construct. Should that be possible?

Pascal.
 
N

Neredbojias

With neither quill nor qualm, JDS quothed:
You need server-side stuff to make this work. Javascript won't help for
what you describe.

Yes it will; I use it often to emulate PHP locally without a server.
Nevertheless, server-side operations are preferable.
 
B

Blinky the Shark

Pascal said:
Unfortunately I've no idea whether my ISP, Plusnet, supports
php. It might well do, but I know even less than nothing about
that! If you could post the required code I'll have a go at it
though...

Oh -- ISP webspace.

I have no hard data, here, but my hunch is that if you're using
freebie ISP space, you're probably not going to have server side
features like PHP.
 
P

Pascal Herczog

bernhard said:
This must be done using server side scripting. Check if you can use php
on your server. it takes less than 10 lines of php code to solve your
prob.

Hmmm - I've actually now got part of it working, so I'm gonna stick with
Javascript for now.

I found that by adding a function that actually returns the value asked for
(duh!), I can get my text to contain the url parameter value. So I used

function qsVal(key) {
return qsParm[key];
}
.... and the previous function posted...

and in the body part,

<script language="javascript" type="text/javascript">
document.write(qsVal('1'));
</script>

nicely in the middle of the text describing the hyperlink.

Only thing is, I can't seem to get this assigned within the <param... bit of
my embedded object.

I'm trying to use

<param name='fileName' value='javascript:qsVal(0)'>

But I can't see why it's not doing anything. Any further help much
appreciated.

Pascal.
 

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
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top