TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 12-04-2008, 01:16 AM   #1 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 9
Thanks: 0
almac007 is on a distinguished road
Default Getting Error: is not a function when viewed in firefox - works in IE

Hi Guys,

Could someone please help me...

I am trying to fix up the site www.thinkpharmacy.com.au

On the right hand side of the home page there are some ads whcih are randomly generated. If you are browsing with Internet Explorer and you click one of these ads you get taken to that particular products page. everything works fine.

The problem i am having is that if i am browsing the site using Firefox and i click one of the ads all i get the following error message...

Error: gid("linkAds" + adsClicked).click is not a function
Source File: http://www.thinkpharmacy.com.au/js/ads.js
Line: 85


I cant understand why this is not working.

Here is a copy of the script ads.js that is being called.

javascript Code:
var xmlHttpAds
   
    function stateChangedAds()
        {
            if (xmlHttpAds.readyState==4)
            {
                //tamResp = xmlHttpAds.responseText.toString().length;
                //if(tamResp > 1){
                    openAds();
                    //alert(xmlHttpAds.responseText);
                    //xmlHttpAds = null;
                //}
            }
        }
       
    function GetxmlHttpObjectAds()
        {
        var xmlHttpAds=null;
        try
          {
          // Firefox, Opera 8.0+, Safari
          xmlHttpAds=new XMLHttpRequest();
          }
        catch (e)
          {
          // Internet Explorer
          try
            {
            xmlHttpAds=new ActiveXObject("Msxml2.XMLHTTP");
            }
          catch (e)
            {
            xmlHttpAds=new ActiveXObject("Microsoft.XMLHTTP");
            }
          }
        return xmlHttpAds;
    }
    var product = '';
    var adsClicked = '';
    var Urlproduct = '';
    function updateAds(id,product_id,Url){
        adsClicked = id;
        xmlHttpAds = GetxmlHttpObjectAds();
        var url = "";
        // DMD - 20060626 - get the host info
        // and make the URL
        switch(window.location.hostname)
        {
        case 'www.thinkpharmacy.com.au':
          var serverNameURL = "http://www.thinkpharmacy.com.au";
          break;   
        case 'tpo.thinkpharmacy.com.au':
          var serverNameURL = "https://tpo.thinkpharmacy.com.au";
          break;
        case 'www.productezine.com':
          var serverNameURL = "https://www.productezine.com/testserver/think";
          break;
        default:
          var serverNameURL = "";
        }
        //alert('passed in is ' + window.location.hostname);
        //alert('servernameurl is ' + serverNameURL);
        // var url="http://www.productezine.com/testserver/think/ajax/updateAds.php?id="+id;
        var url=serverNameURL+"/ajax/updateAds.php?id="+id; 
       
        var url2="http://www.thinkpharmacy.com.au/ajax/updateAds.php?id="+id;   
    //  alert('url2 is ' + url2);
       
        // DMD Edit
    //  alert(url);
        product = product_id;
        xmlHttpAds.onreadystatechange=stateChangedAds;
    //  alert('before redirect');
        xmlHttpAds.open("GET",url,true);
    //  alert('after redirect');
        xmlHttpAds.send(null);
        Urlproduct = Url;
    //  alert('URL Product is ' + Urlproduct);
    }

    function openAds(){
        if(Urlproduct == ""){
            gid("linkAdsProd"+adsClicked).click();
        }else{
            gid("linkAds"+adsClicked).click();
        }
    }


if anybody could help me out i would be very apprieciative.

Thanks in advance,

Almac007

Last edited by Wildhoney : 12-04-2008 at 01:53 AM.
almac007 is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a gallery class Tanax Advanced PHP Programming 25 02-19-2013 04:25 AM
Timezone Class: Dealing with Timezones the Proper Way Wildhoney General 2 01-10-2011 11:01 PM
Part 2: Giving our Currency Conversion Script some Responsibility Wildhoney General 15 03-17-2009 01:53 PM
[Tutorial] How to organize your classes | Part 1 Tanax Advanced PHP Programming 10 03-01-2009 10:08 PM
The hello world contest Village Idiot The Lounge 9 01-07-2008 02:15 PM


All times are GMT. The time now is 09:11 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design