p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional ASP.NET MVC 2 (http://p2p.wrox.com/forumdisplay.php?f=588)
-   -   JavaScript not working (http://p2p.wrox.com/showthread.php?t=90791)

tsansoterra August 30th, 2013 03:29 PM

JavaScript not working
 
I am working on the mapping section in Chapter 1 and everything works as expected except the Longitude/Latitude values are not being passed back to the input controls.

If I embed the map.js code within the actual page everything works fine but when I reference .js file it stops working.

I have tried referencing map.js at all levels starting with site.master and working my way down but still no luck.

Seems odd that the majority of the code within the file is working and I can even set a break point and view the values that are supposed to be passed back but I get nothing.

Can anyone tell me what I am missing?

Thanks,
Todd

tsansoterra August 30th, 2013 07:31 PM

okay...it appears to be a caching issue. If I rename the .js and run then all works fine. Problem now is if I rename the .js back to the original it appears to revert to old functionallity. I have gone through the directory structure and deleted debug objects but that did not help. Also, ctl-f5 does not appear to work either. Any ideas?

tsansoterra August 31st, 2013 03:33 PM

Found a quick fix for this problem…apparently adding a version number to the .js file will force a refresh each time.
Code:

<script src="../../Scripts/Map.js?version=1.0.0" type="text/javascript"></script>

EricCulbertson January 13th, 2014 08:03 AM

is it working in your case ? .. as if it is (hopefully) then i will too try with this as now has got stuck in mid way and there is nothing helpful coming in my way except this

watercalf October 14th, 2014 12:01 AM

Javascript Issues
 
Hello, I am not that good enough about this things but I hope I could contribute something according to what I have read. It is said that, if in case you received error as such Javascript is not redefined or the error is denied. It might be that you are working on any type of web site or application that has any other dependencies. For this case, issues might be resolve by simply defining a variable.


All times are GMT -4. The time now is 06:48 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.