Announcement

Collapse
No announcement yet.

ShowPopUp behaving differently in IE vs. Firefox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ShowPopUp behaving differently in IE vs. Firefox

    Quick Version of problem:

    In the cart, when you click on the product reference number (NOT the description) the kmaShowPopUp is executed (a duplicated version of the ShowPopUp script that includes some character replacement). When using IE, it comes up with "HTTP 403.2 - Forbidden: Read Access Forbidden". In Firefox, I get the Extended Popup just how it should be.

    URL: www.raprec.com/support.html
    userid/pw: testuser/testuser

    ADDITIONAL INFORMATION:

    Looking at the properties for the popup window
    IE is calling: http://www.raprec.com/cgi-bin/info_4_C6X_S.html
    Firefox is calling: http://www.raprec.com/acatalog/info_4_C6X_S.html

    The kmaShowPopUp code
    Code:
    function kmaShowPopUp(kUrl, nWidth, nHeight)
      	{  
    	       kUrl = kUrl.replace(/-/g,"_");
    	       kUrl = kUrl.replace(/ /g,"_");
    	       kUrl = kUrl.replace(/\//g,"_");
    	       kUrl = kUrl.replace(/\\/g,"_");
    	       kUrl = kUrl.replace(/\./g,"_");
    
                   window.open(kUrl + '.html', 'kActPopup', 'width=' + nWidth + ',height=' + nHeight + ',scrollbars, resizable');
    
    
    	if (!bPageIsLoaded)
    		{
    		window.location.reload(true);
    		}
    	}
    (Side note - I'm sure there's a more efficient way to do the replace...I'll cross that bridge later)

    Call from Act_ShoppingCartXML
    Code:
    <a href="javascript:kmaShowPopUp('info_NETQUOTEVAR:PRODREF',400,400);">NETQUOTEVAR:PRODREF</a>

    Help.

    #2
    Both IE and Firefox are doing this link wrongly.

    Firefox is using the BASEHREF value that the cart scripts put in and technically is doing it wrongly although it gets you to the page. As you're a logged-in user the link should really be via the bb00000n.pl script. Look at a normal product page popup link and see what's in the Status Bar.

    IE is ignoring the BASEHREF.

    Anyway the simplest way to make it work for all browsers would be to put

    kUrl = 'http://www.raprec.com/acatalog/' + kurl;

    just before your kmaShowPopUp line.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks for the response...

      Your suggestion caused a bit of trouble still...but, your comment about pointing to the bb000001.pl generated this idea:

      klink = 'http://www.raprec.com/cgi-bin/bb000001.pl?ACTINIC_REFERRER=http://www.raprec.com/cgi-bin/bb000001.pl&PRODUCTPAGE=' + kUrl + '.html';

      Then placing 'klink' within the windows.open command. This works in both browsers...is this proper or will this get me into trouble?

      Comment


        #4
        Your way assumes that your pages will only be viewed by logged-in customers. If this is so then that code should be fine. I'm not sure what would happen if a logged-out person tried to follow this link.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          My post (#3) was premature - after further testing, my solution was causing some problems with the "cancel" button in the cart (clicking on cancel actually loaded the extended popup code into the browser window). So, I went back to look at Norman's suggestion. I made a minor tweak to it and now it is working. Here is how my kmaShowPopup code looks now:

          Code:
          function kmaShowPopUp(kUrl, nWidth, nHeight)
            	{  
          	
          	var klink;
          
          	kUrl = kUrl.replace(/-/g,"_");
          	kUrl = kUrl.replace(/ /g,"_");
          	kUrl = kUrl.replace(/\//g,"_");
          	kUrl = kUrl.replace(/\\/g,"_");
          	kUrl = kUrl.replace(/\./g,"_");
          	klink = 'http://www.raprec.com/acatalog/' + kUrl + '.html';
          
          	window.open(klink, 'kActPopup', 'width=' + nWidth + ',height=' + nHeight + ',scrollbars, resizable');
          
          	if (!bPageIsLoaded)
          		{
          		window.location.reload(true);
          		}
          	}
          Thanks for your help...
          Kristin Amaro.

          Comment

          Working...
          X