Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2007
    Posts
    61
    Plugin Contributions
    0

    Default Quick question - Can I add javascript to ezpage?

    I need to add a javascript (unless there is another way) to an ezpage so when someone clicks on a link on one of my ezpages, it pops open a new, small pop-up window. A new, small window without any headers, sideboxes, etc. just a plain white window, approximately 200 pixels wide by 100 pixels high) with some text. Can this be done? and how? Thanks!

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Quick question - Can I add javascript to ezpage?

    You can replicate the html code for this in the ezpage editor - that is about it!!

  3. #3
    Join Date
    Jan 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Quick question - Can I add javascript to ezpage?

    By html code you mean the calling of the javascript (but that wouldnt work without the actual script in the head? Or is there an html way of pop-up windows that Im not aware of? Thanks for any help. I need to get this page done, just cant figure out a way to do it.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Quick question - Can I add javascript to ezpage?

    this is copied from the html_header.php file and Zen has taken care of this(red emphasis mine):
    Code:
    /**
     * load all site-wide jscript_*.js files from includes/templates/YOURTEMPLATE/jscript, alphabetically
     */
      $directory_array = $template->get_template_part($template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript'), '/^jscript_/', '.js');
      while(list ($key, $value) = each($directory_array)) {
        echo '<script type="text/javascript" src="' .  $template->get_template_dir('.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/' . $value . '"></script>'."\n";
      }

  5. #5
    Join Date
    Jan 2007
    Posts
    61
    Plugin Contributions
    0

    Default Re: Quick question - Can I add javascript to ezpage?

    Ok, to make sure I'm understanding you correctly, I place my .js file with my javascript coding into my custom template/jscript directory, however how would I call the file in html? I've used plenty of javascripts before, but they have all just been called from the header of the same page, not externally. Can you tell me how to call that file, or where I can go to find out how to call an external .js file? I'm not familiar enough to write my own javascript code. Thanks

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Quick question - Can I add javascript to ezpage?

    Ok, to make sure I'm understanding you correctly, I place my .js file with my javascript coding into my custom template/jscript directory, however how would I call the file in html?
    Just the .js goes there not yur coding - you code is the html that you place in the editor for ezpages
    I've used plenty of javascripts before, but they have all just been called from the header of the same page, not externally. Can you tell me how to call that file, or where I can go to find out how to call an external .js file?
    Re-read my last posting - Zen does this

  7. #7
    Join Date
    Apr 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Quick question - Can I add javascript to ezpage?

    Gourmets

    Did you manage to get this working as I don't really understand kobra's post

    If I wanted to get a simple script like this
    http://www.dynamicdrive.com/dynamici...flexislide.htm
    working in an Ez page have you any idea how I might do this

    tks

  8. #8
    Join Date
    Apr 2008
    Location
    Missoula, MT
    Posts
    59
    Plugin Contributions
    0

    Default Re: Quick question - Can I add javascript to ezpage?

    Quote Originally Posted by ndillane View Post
    Gourmets

    Did you manage to get this working as I don't really understand kobra's post

    If I wanted to get a simple script like this
    http://www.dynamicdrive.com/dynamici...flexislide.htm
    working in an Ez page have you any idea how I might do this

    tks
    Hey guys...what Cobra is saying is that zencart automatically loads javascript that has been placed in the correct place. The hitch...is that it has to be named correctly.

    includes/templates/CUSTOM/jscript/

    place your .js file in the above folder...you MUST add jscript_ to the front of the name. So if your file looks like this...

    includes/templates/CUSTOM/jscript/silly.js

    change it to this...

    includes/templates/CUSTOM/jscript/jscript_silly.js

    and it gets automatically loaded by html_header.php (which is what cobra was trying to demonstrate)...the key is in naming it correctly =) hope that saves yall some headaches, it certainly gave me one for a few days.

 

 

Similar Threads

  1. can't update an EzPage
    By infowire in forum General Questions
    Replies: 8
    Last Post: 13 Mar 2011, 03:26 AM
  2. Can't add <textarea> in form on my EZpage
    By sfklaas in forum General Questions
    Replies: 9
    Last Post: 28 Mar 2009, 04:16 PM
  3. Replies: 5
    Last Post: 14 Feb 2008, 07:54 AM
  4. quick question. Can ALL files use template override?
    By budfox in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 14 Apr 2007, 07:57 AM

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