Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default javascript window

    Hi

    In this file:

    /custom_template/includes/languages/english/product_info.php

    and this section:

    TEXT_MORE_INFORMATION', 'For more information, please visit this product\'s <a href="%s" target="_blank">webpage</a>.');

    This is the link that shows on the product page.

    I plan to use this link for a different purpose and would like the window that opens up to open without displaying the toolbar or location.


    Though I don't know anything about javascript coding I am assuming I would need to use the

    javascript window.open function.

    I have found a ready made script but because the line is in a php file and not an html file I have no idea where it belongs or how to go about it.

    Can anyone tell me where the script should be placed and how to link the "a href=" in the "TEXT_MORE_INFORMATION" phrase to the script?

    Any help would be really appreciated.

  2. #2
    Join Date
    Dec 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: javascript window

    This sounds very similar to what I am trying to do, I am currently trying to add a popup window to the product info page linked by a image. This is the code I have in a .js file in /includes/modules/pages/product_info/jsscript_360view.js as stated in an other thread.

    PHP Code:
    var newwindow ''
    function popitup(url) {
    if (
    newwindow.location && !newwindow.closed) {
        
    newwindow.location.href url;
        
    newwindow.focus(); }
    else {
        
    newwindow=window.open(url,'htmlname','width=404,height=316,resizable=1');}
    }

    function 
    tidy() {
    if (
    newwindow.location && !newwindow.closed) {
       
    newwindow.close(); }

    I would like to add different images for each product so I am downloading the file link in EasyPopulate.

    I just cannot work out how to call the javascript in the html code. The code that should be used in the body of the html is:
    PHP Code:
    <A HREF="javascript:popitup('test.jpg')"><IMG SRC="testi.jpg" WIDTH="160" BORDER="0" HEIGHT="120" HSPACE="10" VSPACE="5" ALT="Test" TITLE="Test" ALIGN=left></A
    This may help, and any advice would be good !

  3. #3
    Join Date
    Dec 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: javascript window

    OK got it working to do what I wanted I needed to put the jscript_yourfilename.js file in
    includes/templates/template_default/jscript/
    So on every page it loads the .js file and then insert
    PHP Code:
    <A HREF="javascript:popitup('test.jpg')"><IMG SRC="testi.jpg" WIDTH="160" BORDER="0" HEIGHT="120" HSPACE="10" VSPACE="5" ALT="Test" TITLE="Test" ALIGN=left></A
    into the body of the html for the description (in EP).
    So because the javascript loads with the page calling the function works as if it is in the head of the page
    Last edited by Scrat; 19 Jul 2008 at 05:07 PM.

  4. #4
    Join Date
    Dec 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: javascript window

    Sorry needed to add this ;
    Basically all you would need to do is insert your .html page link instead of my .jpg's with out the image info
    Remove <IMG SRC="testi.jpg" WIDTH="160" BORDER="0" HEIGHT="120" HSPACE="10" VSPACE="5">

  5. #5
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: javascript window

    Thanks your reply Scrat. Will give your suggestion a try.

 

 

Similar Threads

  1. Javascript window.onload=function placement
    By usr50 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Apr 2011, 10:53 PM
  2. Javascript popup window. What am I missing?
    By rovinghouse in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Dec 2010, 07:06 PM
  3. Question about "javascript:window.close()"
    By Cyan in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 12 Nov 2010, 07:27 PM
  4. Creating a javascript popup window?
    By stlnyc in forum General Questions
    Replies: 1
    Last Post: 18 May 2009, 01:54 PM
  5. Trying to use Javascript window.opener to redraw the page
    By bestrong in forum General Questions
    Replies: 3
    Last Post: 23 Dec 2008, 03:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR