Lisa23 Posted July 9, 2011 Share Posted July 9, 2011 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> Quote Link to comment https://forums.phpfreaks.com/topic/241516-simple-jwplay-video-link-inside-function-stops-the-function-from-display-why/ Share on other sites More sharing options...
Lisa23 Posted July 9, 2011 Author Share Posted July 9, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/241516-simple-jwplay-video-link-inside-function-stops-the-function-from-display-why/#findComment-1240600 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.