www.webdeveloper.com
Results 1 to 5 of 5

Thread: script link with php variable in

  1. #1
    Join Date
    Mar 2005
    Posts
    262

    script link with php variable in

    <?php echo ("<script src='\".$path."\"/assets/scripts/rounded.js' type='text/javascript'></script>");?>

    Does anyone know why this doesnt see the rounded file?

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    i would say you have a huge mismatch of quotes.

    Couldn't you have just made these 2 one topic?

    anyways you should do this
    PHP Code:
    <?php
    echo ("<script src=\'".$path."/assets/scripts/rounded.js\' type=\'text/javascript\'></script>");
    ?>

  3. #3
    Join Date
    Dec 2002
    Location
    Seattle, WA
    Posts
    1,843
    for compatibility issue with html and xhtml you should use double quotes
    PHP Code:
    <?php
    echo "<script src=\"$path/assets/scripts/rounded.js\" type=\"text/javascript\"></script>";
    ?>
    see your other thread for an alternative (i have repeating myself lol)

  4. #4
    Join Date
    Mar 2005
    Posts
    262
    Thank you for your reply, it displays the links correctly, after viewing the view source. For some reason it is not really doing what the scripts really should be doing, but it displays it in one long string:
    PHP Code:
    <script src="/www/1uwafc/assets/scripts/nifty.js" type="text/javascript"></script><script src="/www/1uwafc/assets/scripts/rounded.js" type="text/javascript"></script><script src="/www/1uwafc/assets/scripts/quotes.js' type="text/javascript></script><script src="/www/1uwafc/assets/scripts/preloadimages.js" type="text/javascript"></script><script src="/www/1uwafc/assets/scripts/symerror.js"type="text/javascript"></script></head> 

  5. #5
    Join Date
    Mar 2005
    Posts
    262
    Scrap that last question I have figured it out, I'm using <?=$path?> instead which works well, thank you, for your help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles