Jump to content

simple jwplay video link inside function stops the function from display why


Lisa23

Recommended Posts

Hi i have the a drop down list that depending on the user selection display the list of results

for example if (select color) display (red, blue, pink)

if select car display(ford,bentley,ferrari) and so on

but now i'm trying to add a link to call video jwplayer so i try to add the link

to be like this if select color (orange, blue) but i am trying to get the color text into a link to call the jwplayer video but the dropdown stops working completely, i suspect it might be (onClick="jwplayer().load) because if i try a normal link e.g. to a different page works fine but when i try the jwplayer link drop down doesnt display results

here the line i am trying to add

 lit = lit + '<a href="#" ({'file': 'hofbell30732_SD.mp4', 'hd.file': 'videos/film.mp4'})"> ORANGE</a>'

 

here my full code

<HTML>
<HEAD>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function setup(ans) {
  lit = ''
  if (ans == 'color') {

    lit = lit + '<br/>blue<br/>'
    lit = lit + '<br/>red<br/>'
    lit = lit + '<br/>green<br/>'
    lit = lit + '<br/>pink<br/>'
    lit = lit + '<br/>yellow<br/>'
  }
  if (ans == 'number') {
    lit = lit + '<br/>one<br/>'
    lit = lit + '<br/>two<br/>'
    lit = lit + '<br/>three<br/>'
    lit = lit + '<br/>four<br/>'
    lit = lit + '<br/>five<br/>'

  }


if (ans == 'car') {
    lit = lit + '<br/>ferrari<br/>'  
    lit = lit + '<br/>bentley<br/>'
    lit = lit + '<br/>ford<br/>'
    lit = lit + '<br/>mustang<br/>'

  }
  document.getElementById('rep').innerHTML=lit
}
</SCRIPT>
</HEAD>
<BODY>

<FORM ACTION="#" NAME="quest">
<SELECT NAME="q1" ONCHANGE="setup(document.quest.q1.value)">
<OPTION VALUE="">- Please select -</OPTION>
<OPTION VALUE="color">Color</OPTION>
<OPTION VALUE="number">Number</OPTION>
<OPTION VALUE="cars">Cars</OPTION>
</SELECT>

<SPAN ID="rep"></SPAN>

</FORM>

</BODY>
</HTML>

ok i manage to get the drop down list to display the results again as it seems had to make single quotes(') into double quotes (") inside the curly brackets but now the link doesnt work how can i allow single quotes or make the link work again

this how the kink works outside the function with single (')

<a href="#" onClick="jwplayer().load({'file': 'hofbell30732_SD.mp4', 'hd.file': 'videos/film.mp4'})'>    javascript video with hd file not working</a>

 

now inside the function had to change the quotes to double quotes inside the curly brackets

<a href="#" onClick="jwplayer().load({'file': 'hofbell30732_SD.mp4', 'hd.file': 'videos/film.mp4'})'>    javascript video with hd file not working</a>

but the link doesnt work with double quotes

how can i get it to work insid ethe function

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.