0

I am trying to get the output of my jQuery in google when displaying. However my jQuery does not work anymore and it keep displaying this debugger:///VM###.

This is my code:

 $(document).ready(function () {
        var getJsonData = $.getJSON("json/travel.json")
            .done(function (data) {
                console.log("hello");
            });

Method I have tried:

  1. clear console
  2. restarting computer
  3. restarting app
  4. refreshing my cache

Did it save to the server? Any solution or advice? Thanks!

Image

Rob
  • 14,746
  • 28
  • 47
  • 65
John
  • 1
  • 1
  • It looks like the output in the console is an array you entered before. And it is shown constantly because of `Autocomplete from history` is set. – extempl Sep 08 '18 at 03:31
  • What is this autocomplete from history? I did not use any VM to run the code. Could the reason be that $.getJson save my data to the localhost? – John Sep 08 '18 at 03:39
  • Actually, I am wrong here with `autocomplete` as it does not presets outputs, it just helps you to autocomplete when you manually input something into the console. However, VM stands for the code located in the memory of the Chrome, not on your site. This happens when you enter something into the console manually. Could you share screenshots from several places, please? Network tab (after js is done), and screenshots by clicking on that `:///VM###` string (this is a link to part of the code). – extempl Sep 08 '18 at 03:47
  • Does the code reach this line: `console.log()`? test this by using `alert('hello')` instead of `console.log`. – Hassan Sadeghi Sep 08 '18 at 05:24
  • it does not reach my console.log(), however it does run on alert(). What does this VM mean? When trying to run on other browser it is working fine just now on chrome. But on the network site it is showing code 200. Does a javascript lag when running on localhost? – John Sep 09 '18 at 07:38

3 Answers3

0

It looks like the output in the console is an array you entered before. And it is shown constantly because of Autocomplete from history is set.

So, answering your question - no, as console haven't output hello, then the request was failed. You can see all the requests on the Network tab and see why it was failed. Probably the URL does not exist, so there may be a request to JSON with 404.

extempl
  • 2,987
  • 1
  • 26
  • 38
0

Did it save to the server?

You are not requesting to save (POST) anything, instead you are actually making a (GET) request to retrieve a json file. In order for that to work, you must be serving up that file from a web server. See This answer.

Isaac Vidrine
  • 1,568
  • 1
  • 8
  • 20
0

Solved

Apparently, I believe my javascript is being store into the disk cache. Which maybe why it will continue to store the data even though u try to close the app or restart the computer.If Ctrl + F5 did not work, go to More tool > clear browsing data > tick clear caches and files. which really did the clearing completely!

Memory cache is stored on RAM, which is faster to write and access, but will be wiped out when the computer turns off or in certain other situations. Disk cache is written to the hard drive, which is slower to read and write, but it will stay on the disk.

However why does it still run on VM instead of my index.html?

John
  • 1
  • 1