SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript works fine in one location...now not running on new server?

    I am using Nifty Corners on a website (http://www.html.it/articoli/niftycube/index.html), which uses Javascript and CSS to create rounded corners for divs.

    In the testing environment, everything works fine as expected. But when I upload to the client's server, the Javascript completely dies on all browsers even though the files are identical.

    Is there some kind of server setting that might be interfering with scripts being run?

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you testing on a Windows machine locally and then a Linux box for the server? If so you need to check case-sensitive things (like file names etc) and file paths.

    Let's see your link to your JS ... more than likely that's the issue

  3. #3
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks dc, here is the code within the <head> tag. It was originally being tested on a different server (Dreamhost server), not locally

    <link rel="stylesheet" type="text/css" href="./css/niftyCorners.css">
    <link rel="stylesheet" type="text/css" href="./css/niftyPrint.css" media="print">
    <script type="text/javascript" src="./js/nifty.js"></script>
    <script type="text/javascript">
    window.onload=function(){
    if(!NiftyCheck())
    return;
    Rounded("div#container","top","#8CC81A","#CDE54E","smooth");
    Rounded("div#container","bottom","#8CC81A","#CDE54E","smooth");
    Rounded("div#tab_right","tl","#F8FEF4","#FFC018","smooth");
    Rounded("div#tab_right_top","br","#F8FEF4","#FFC018","smooth");
    Rounded("div#tab_left","tl","#F8FEF4","#8CC81A","smooth");
    Rounded("div#tab_left_top","br","#F8FEF4","#8CC81A","smooth");


    }
    </script>

  4. #4
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try changing your JS link to this:

    <script type="text/javascript" src="/js/nifty.js"></script>

    As long as your js folder is in your public_html folder should work like a champ

  5. #5
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help, everything is fine now!


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
  •