www.webdeveloper.com
Results 1 to 9 of 9

Thread: src and link tags not working

  1. #1
    Join Date
    Jan 2011
    Posts
    39

    src and link tags not working

    We have a project where the src and link tags work on one computer but not on another. The code is the same on both computers.
    What could cause this ?

  2. #2
    Join Date
    Aug 2006
    Posts
    1,931
    Pretty hard to tell without seeing the code or web site. One example might be a src or url that points to something on a C: drive. One computer might have the file on the C: drive, the other might not.

    Dave

  3. #3
    Join Date
    Jul 2009
    Posts
    184
    Like tracknut said, it's pretty hard to know what's happening without seeing some code: but, another possibility is that on the computer that works, the site is running at http://localhost/, and on the computer that doesn't work the site is attempting to run from http://localhost/yourwebsite/. This could cause all the anchor links, link, and script tags to look at the wrong spot.

  4. #4
    Join Date
    Mar 2012
    Posts
    1,724
    You really have not given enough info to reliably diagnose the cause, but another candidate for code working on one computer and not another is capitalization. Windows does not care if a file is called "MyPage.html" or "mypage.html", both will work. But Linux is case sensitive, so the links and src code can fail if a file or path is not precisely correct. Oh, and it's best to avoid spaces in file and path names.

    It may not be relevant, but I hope that helps...

  5. #5
    Join Date
    Jan 2011
    Posts
    39
    Thank you for replies.
    Code in each place is the same and the .css and .js files are in the same directory as the .htm and .cfm files referencing them. The .css and .js are being seen in development but not in live.

    Could this have something to do with user accounts and priviledges ?

  6. #6
    Join Date
    Jan 2011
    Posts
    39
    By ".css and .js are being seen" in my post above, I meant seen by the .htm and .cfm files - the styles show and the js functions get called.
    Last edited by neginf; 08-30-2012 at 02:14 PM.

  7. #7
    Join Date
    Mar 2011
    Posts
    1,147
    Again, the easiest way to diagnose the problem is to load the page that doesn't work in your browser and use "View Source" to examine the source code for the page. That will show you the URLs that the browser is trying to use to find these external files.

    If you used absolute addressing (ie. 'http://www.example.com/css/styles.css'), then the domain name is probably incorrect. If you used relative addressing (ie. '/styles/styles.css'), then there's an issue with the relative paths. In either case, it should be easy enough to spot and correct the problem.

  8. #8
    Join Date
    Jan 2011
    Posts
    39
    It was a mistake in a Java installation.

  9. #9
    Join Date
    Sep 2012
    Posts
    2
    I am totally agree with what you said,but my English is poor, sometiomes I don't know how to express my feeling,I just want to make some friends who can help me in my English and share the happiness with each other.

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