View Full Version : AnyLink Menu with JS Links

09-15-2008, 04:49 AM
1) Script Title: AnyLink Drop Down Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem: one page "A" i have an instance of the jw player that i am trying to load a new file into through its api. in page "A" there is an iframe that page "B" gets loaded into. the anylink menu is on page "B". the link i normally use from page "B" to control the jw player on page "A" is:

<a href="#" onclick="javascript:loadNplay('song03.mp3', 'http://domain.org/wp-content/uploads/2008/08', 'sound', 'http://domain.org/pictures/show_00000012/2401711130.jpg', 'http://domain.org/show'); return false;">show</a>

however when i add this as a link in the menu array when the code gets to the first http:// it comments the rest of the line out in my editor so i am pretty sure thats my problem. here is the code i am using for the link from the anylink menu array:

menu1[0]='<a href="#" onclick="javascript:loadNplay('song03.mp3', 'http://domain.org/wp-content/uploads/2008/08', 'sound', 'http://domain.org/pictures/show_00000012/2401711130.jpg', 'http://domain.org/show'); return false;">show</a>'

any idea how i can get this to work?

09-15-2008, 05:31 AM
Try something like:

menu1[0]='<a href="#" onclick="loadNplay(\'song03.mp3\', \'http://domain.org/wp-content/uploads/2008/08\', \'sound\', \'http://domain.org/pictures/show_00000012/2401711130.jpg\', \'http://domain.org/show\'); return false;">show</a>'

09-15-2008, 02:37 PM
that did the trick, thanks very much. the final code looks like this:

menu1[0]='<a href="#" onclick="javascript:parent.loadNplay(\'song03.mp3\', \'http://domain.org/wp-content/uploads/2008/08\', \'sound\', \'http://domain.org/pictures/show_00000012/2401711130.jpg\', \'http://domain.org/show\'); return false;">Show</a>'

notice the parent.loadNplay, which changes the links focus from the iframe to the parent page, which i forgot last night. what an amazing site you guys have here. thanks again.