Jump to content

Using a .js file for links


big-dog1965

Recommended Posts

How do I get this to work

the top link is what I want to do the 2nd works but in a whole new page

I want it in my frame as the top one indicates

NOTE if the top one is left in the whole thing bombs out and no links show up at all

function toprightmenu()
{
retVal = 
"<a target=\"mainframe"href=\"../forms/Contest/contest.html\">Win My Windows</a><br> " +
"<a href=\"forms/Contest/contest.html\">Win My Windows</a><br> " +
"<a href=\"http\">Some Other Link</a><br> " +
"<a href=\"http\">Some Other Link</a>";

return retVal;
} 

Link to comment
https://forums.phpfreaks.com/topic/168762-using-a-js-file-for-links/
Share on other sites

You have to escape quotes if they are within quotes, i.e:

 

"<a target=\"mainframe\" href=\"../forms/Contest/contest.html\">Win My Windows</a><br> " +

 

Note the added slash after 'mainframe'. You'll need to add that target to each link you want to open within the frame.

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.