Forum Moderators: open

Message Too Old, No Replies

External calling of javascript code

External calling of javascript code

         

benevolent001

2:45 am on May 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have 3 different javascript codes given by phpadsnew for placing ads on my website.When i place all of those 3 i feel that page becomes bulky and size is large

So i was wondering is there any way to call the javascripts codes from a external file as we can do for the css files

for example i place all codes A B C in the external file J.jsp

i know some kind of javascripts can be called from external files but how these ads codes will be called,and how will i tell page to extecute this javasctipt code over this area and ..

place ad for code A here
place ads for code B here

any help in this regards with CODES will be greatly appreciated i dont know javascript so cant do it myself

thanks

benevolent001

3:12 am on May 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tried to use this after i googled external calling of javascript

placed this in header
<SCRIPT language="JavaScript" SRC="ads.js"></SCRIPT>

in ads.js i placed code given by phpadsnew as

function rectangle() 
{
code given by phpads new for rectangle ad
}

placed this at place where i wanted ads to display

<A HREF="javascript:rectangle()"></A>

didnt worked :(

benevolent001

3:29 am on May 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IS there any way i can do this using iframes?
i have seen this code on one website

<iframe name="" id="" src="" width="140" height="60" MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no" align="center" title="Advertisement"><a href="" target="_blank"><img src="" border="0" width="140" height="60" alt="Advertisement"></a></iframe>

benevolent001

1:51 pm on May 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



bump :)

Dijkgraaf

2:28 am on Jun 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Where you want the add to display you need to have the following

<script>
rectangle();
</script>

kevinjohn

10:24 am on Jun 9, 2005 (gmt 0)

10+ Year Member



Hi,
You could call those java script functions during " body onload"

<body onload="function1();fucntion2()">

Let me know if this one helps u.

kevinjohn

10:24 am on Jun 9, 2005 (gmt 0)

10+ Year Member



Hi,
You could call those java script functions during " body onload"

<body onload="function1();function2()">

Let me know if this one helps u.