Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default execute a javascript

    The following java script is for executing Google Translation of a web page from English to Spanish

    javascript:var%20t=((window.getSelection&&window.getSelection())||(document.getS election&&document.getSelection())||(document.selection&&document.selection.crea teRange&&document.selection.createRange().text));var%20e=(document.charset||docu ment.characterSet);if(t!='')%7blocation.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=auto|es&tbb=1&ie='+e;%7delse%7blocation.hr ef='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=auto|es&tbb=1&ie='+e;%7d;

    I would like to be able to execute this script when I click on text
    on my home page ( eg Nos Hablamos Espanol). I know that it is bad practice, and in fact may not even work, to put javasript in
    the PHP code. The question is, how do I go about incorporating
    the javascript into my web site in order to perform the task at
    hand?

    I am not a java programmer and in fact am still learning PHP and HTML. Anybody able to help me with this?

  2. #2
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: execute a javascript

    there is a free addon that dose that .. you may want to check it out .

    http://www.zen-cart.com/index.php?ma...roducts_id=233

  3. #3
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default Re: execute a javascript

    Thanks for the response. I knew about that addon. The thing I was
    trying to accomplish is to translate the page without actually leaving
    the page. Google accomplishes this with a button that can be added
    to the browser tool bar. I was hoping to essentially run the
    javascript for those buttons via a link within my homepage. Hope
    that makes sense.

    However, in the final analysis, I will probably not incorporate any
    translations. The reason is that some of the terminology used in
    the site is specific to the product and would not translate correctly.
    Hence, a lot could be lost in translation.

    Thanks anyway for your help and suggestion!

 

 

Similar Threads

  1. Execute API on successful order
    By max4u in forum All Other Contributions/Addons
    Replies: 21
    Last Post: 5 Oct 2012, 02:36 PM
  2. Amount of rows with $db->Execute?
    By joecooper in forum General Questions
    Replies: 3
    Last Post: 15 Feb 2012, 11:46 PM
  3. Query to execute if then in phpmyadmin
    By ginjack in forum General Questions
    Replies: 2
    Last Post: 20 Nov 2009, 10:42 AM
  4. $db->Execute throwing error
    By artcoder in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 May 2008, 10:51 PM
  5. db->Execute with while statement...
    By modernm in forum Contribution-Writing Guidelines
    Replies: 2
    Last Post: 7 Mar 2008, 08:27 PM

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