Javascript Question for JS Pros Convert Inline Code to Separate File

5 replies
Hi Friends,

I have this situation related to JS , will love to get input from JS Experts:


Purpose:
======

Make the AREA MAP link on a Image Map open in Small Window


Solution Inline JS:
======
Code:
<img name="Page1" src="Page1.jpg" width="950" height="1425" border="0" id="Page1" usemap="#m_Page1" alt="" />

<map name="m_Page1" id="m_Page1">
<area shape="poly" coords="695,1008,691,892,371,895,370,962,474,958,480,1005" href="img/p.jpg"  target="_blank" alt="" onclick="window.open(this.href,'','width=800, height=950, top=150, left=250');return false;"  />

</map>
This above inline Javascript code works exactly the way we wanted.
But problem is that we want to have JS in separate file and not inline,
so that every AREA link of IMAGE MAP behaves just like this i.e. Open small window as
is done by this inline code.

As i am do not know much about JS coding, i have tried to google for this solution
but was unable to follow the suggested course as it seems this situation is unique...

Oh yeah one thing i.e. the page with html code with AREA links of Image MAP is not
in our control and we include it using PHP so we cannot directly edit those HTML pages
with AREA MAP links... we need something on site wide which can alter those links
using JS.

Thanks for your time and hope you have some suggestions for me.

Regards,
Mohsin
#code #convert #file #inline #javascript #pros #question #separate

Trending Topics