SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    E-business guru Eirik's Avatar
    Join Date
    Nov 2000
    Location
    Oslo, Norway
    Posts
    413
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Varible excluding some content

    Hi,

    Can anyone tell me why a var. when declared the following way:

    PHP Code:
    $head_parameters 
    "<SCRIPT LANGUAGE=\"javascript\">\n" 
    "<!-- hide from old browsers\n" 
    "function gotowizard() \n" 
    "{ \n" 
    "var simpleform = \"http://www.commission-junction.com/track/track.dll?AID=365409&PID=445343&URL=http://x.moreover.com/images/commjunct/redirect8.html\"\n" 
    "// open the new window\n" 
    "var newwin = window.open(simpleform,\"wizard\",\"status,resizable,scrollbars,width=500,height=550\")\n" 
    "//  newwin.focus()\n" 
    "}\n" 
    "// end hiding -->\n" 
    "</SCRIPT>\n"
    ...only prints out:

    <SCRIPT LANGUAGE="javascript">
    <!-- hide from old browsers
    function gotowizard()

    // end hiding -->
    </SCRIPT>
    Is there something PHP specific in the JS code that I shold be aware of?

    Thanks in advance !
    Sincerely,

    Eirik Johansen
    Netmaking AS

  2. #2
    SitePoint Member
    Join Date
    Jun 2001
    Location
    germany
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope.

    but why don't you make a file headparams.php with the javascript inside (plain, not in php-tags!) and include it in the file, where you need it?

    file headparams.php:
    <SCRIPT LANGUAGE="javascript">
    <!-- hide from old browsers
    function gotowizard()
    {
    var simpleform = "http://www.commission-junction.com/track/track.dll?AID=365409&PID=445343&URL=http://x.moreover.com/images/commjunct/redirect8.html"\
    open the new window
    var newwin = window.open(simpleform,"wizard","status,resizable,scrollbars,width=500,height=550")
    // newwin.focus()
    }
    // end hiding -->
    </SCRIPT>

    But... why do you comment out the newwin.focus()?

    In the file where you need the headparams, just include:
    include('headparams.php');

    That should do it.

    greetings bombel

  3. #3
    E-business guru Eirik's Avatar
    Join Date
    Nov 2000
    Location
    Oslo, Norway
    Posts
    413
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestion. However, since I'm working with templates, I can not use the method you describe. Thanks anyway!

    There's no particular reason why I've commented out the focus(). The default code had it commented out, and I haven't changed it.

    Anyone else able to spot the error?
    Sincerely,

    Eirik Johansen
    Netmaking AS

  4. #4
    SitePoint Zealot cokeman's Avatar
    Join Date
    Dec 2000
    Location
    So. California
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I pasted that code in, it worked fine..

    Is it possible that you might have some line that modifies $head_parameters?


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
  •