Author Topic: Bizarre JS Problem  (Read 369 times)

Offline AltarofScience

  • Level 12
  • *
  • Posts: 90
  • Reputation: +1/-0
    • View Profile
Bizarre JS Problem
« on: January 16, 2012, 03:52:18 PM »
I wrote some code in JS and I run it on my personal laptop and also my online webhost.
On my laptop the code performs as intended. On the webhost it does not.
I literally copy pasted the code that worked from my laptop to the webhost server. But for some reason it doesn't work.
What kinds of things would cause this problem? Aside from this tiny aspect the code functions perfectly on the server.

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Bizarre JS Problem
« Reply #1 on: January 16, 2012, 05:20:03 PM »
- network latency, some problems might be visible only due to network slowness (like my test map code works fine on localhost but is unbearbable glithy on a live host
- check if you copied it perfectly, download it and compare (FTP errors, especially on crappy hosts)
- something related to caching maybe?

Offline AltarofScience

  • Level 12
  • *
  • Posts: 90
  • Reputation: +1/-0
    • View Profile
Re: Bizarre JS Problem
« Reply #2 on: January 16, 2012, 05:25:22 PM »
I cleared out all the files, changed the names when re-uploaded and got it to work. It took me a while to do that. Was so irritating.

Offline boolean

  • Level 4
  • *
  • Posts: 12
  • Reputation: +0/-0
    • View Profile
Re: Bizarre JS Problem
« Reply #3 on: January 22, 2012, 08:55:58 AM »
You might already be using these tools if you are a js developer, but in case you aren't:

1) Get Firebug: http://getfirebug.com/
2) Open your page and go to the 'Net' tab. This will show all the files that the page downloaded. If the problem was a pathing error it will show as a great big red entry.
3) Open the 'Console' tab - This shows all the requests going back and forth to the server. If your js file is doing any sort of postback to the server this is a good place to catch any failed requests.

It looks like you already solved the problem anyway, so this post might be useless  ;D

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal