0

I have been working on getting the client date and passing it to the server on loading an aspx page, but a problem has arisen:

I wrote a function called ClientDate() in my custom ppm.js library, and I wrote some vb.net codebehind which creates a startup JavaScript that calls that function on startup and saves the output to a textbox.

It seemed to be working correctly until I decided to change the format of the date returned by ClientDate() from yyyymmdd to yyyy-mm-dd. The textbox continued to display the date in the old format. When I changed the function output to "Hello, World", it continued to display the date in the old format, and when I commented out the function completely in the library, it still displayed the date in that format. Restarting and rebooting the computer have no effect.

Clearly, my page is finding ClientDate() someplace else. I searched my project for ClientDate() and found only two occurrences, once in the library and once in the startup JavaScript that calls it.

I can think of 2 possible explanations (but don't believe any of them):

  1. There is a built-in JavaScript or jQuery function called ClientDate() that is being called instead of mine.

  2. There is a hidden file containing an older version of the ClientDate() function.

Any ideas how I can track this bug down?

Cerbrus
  • 70,800
  • 18
  • 132
  • 147
  • Have you tried to change the function name and invocation? – borja gómez Jul 03 '15 at 10:25
  • You done a Ctrl-f5 to clear your cache? The js could be being cached by the client. – Liam Jul 03 '15 at 10:25
  • If you [debug the js](http://stackoverflow.com/questions/988363/how-can-i-debug-my-javascript-code) does the function get hit and work as expected? – Liam Jul 03 '15 at 10:26
  • In response to the (amazingly swift) responses by borja and Liam: When I change the function name in the library only, it has no effect on the output. When I change the function name in the calling javascript, I get nothing in the textbox. Ctl-f5 produces the usual incorrect output. The startup javascript runs but does not call the function in my library. When I put a stop on the first line of the ClientDate() function in my library, the page puts the incorrect output in the textbox without ever stopping. – Sheldon M. Penner Jul 03 '15 at 10:55
  • When I rename ppm.js to _ppm.js but leave the reference on the page as – Sheldon M. Penner Jul 03 '15 at 13:20

0 Answers0