Welcome Guest. Sign in or Signup

6 Answers

external js file in html banner

Asked by: iqawi 507 views User Questions

I checked the forum and KB but couldn’t find any mention about use of external javascript files in html ads.

I am trying to setup an html banner ad with javascript created by one of our ad partners. Most of the code lives in an external javascript file – a call is made to method in the external file to serve the ad. When I setup this ad media, I get an error during ad preview.

Below is a sample:


Can this be used with html banner ad in Advertpro? Thanks.

6 Answers



  1. renegade_mike on Jun 22, 2008

    Yes, JavaScript is fine as long as it’s loaded with tags. We still consider it HTML code.

    The problem here is with the external script:

    http://www.partnersite.com/scripts/myWidget.js

    It redirects to http://www.partnersite.com/ and the tag is trying to load the HTML content of that page, which is causing a JavaScript syntax error so I think you need to contact the site to find out what's happening here -- maybe they moved the script to a different location.

    0 Votes Thumb up 0 Votes Thumb down 0 Votes



  2. iqawi on Jun 23, 2008

    Thanks for your response.

    I had not included the actual path to the external file. That file is reachable and is served ok. It has some js function definitions which are called in the html banner code.

    The actual code I’m using for media is as follows:


    This is giving error when I try to preview ad – message states that function cannot be found.
    Using this code directly in an html page, the banner ad is served without problem.

    0 Votes Thumb up 0 Votes Thumb down 0 Votes



  3. renegade_mike on Jun 23, 2008

    This code works for me in the preview. Perhaps I should check over your AdvertPRO installation to make sure it’s working properly. Could you create an administrator account for me to access it (or just provide the current admin password)? You can use this secure/encrypted form to submit that information to me: https://services.renegadeinternet.com/infosubmit/

    0 Votes Thumb up 0 Votes Thumb down 0 Votes



  4. iqawi on Jun 23, 2008

    I have sent admin account info via secure form. Please take a look at our installation.

    0 Votes Thumb up 0 Votes Thumb down 0 Votes



  5. renegade_mike on Jun 23, 2008

    Ok, it’s only Internet Explorer that gives an error. Firefox and Opera both load the external JavaScript fine.

    Moving the JavaScript inline to the code, which I see you did already (media #1960) avoids the error in Internet Explorer.

    I believe the problem is there are too many levels of nested script tags, which Internet Explorer is known to have trouble with. We have one script tag embedded in the AdvertPRO zone code, another two embedded in the code for the media, and then the external script generates an embeds another script tag to load the actual search form. I am not sure what you could do to work around this other than to eliminate some of the nesting as you’ve already done by bringing the external script inline with the code.

    0 Votes Thumb up 0 Votes Thumb down 0 Votes



  6. iqawi on Jun 24, 2008

    As per your suggestion I tried this in FF and it works fine. Thanks for your help.

    0 Votes Thumb up 0 Votes Thumb down 0 Votes