I have been adding logs to the console to check the status of different variables without using the Firefox debugger.
However, in many places in which I add a
The question raised in 2014 and it's 2019 so I guess it's good to look for better option.
You can simply use fetch
api in Javascript which provide you more flexibility.
for example, see this code
fetch('./api/some.json')
.then((response) => {
response.json().then((data) => {
...
});
})
.catch((err) => { ... });
I fixed this with below steps:
It was happening to me in ZF2. I was trying to load the Modal content but I forgot to disable the layout before.
So:
$viewModel = new ViewModel();
$viewModel->setTerminal(true);
return $viewModel;
Like @Nycen I also got this error because of a link to Cloudfare. Mine was for the Select2 plugin.
to fix it I just removed
src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js"
and the error went away.
I get such warning in following case:
1) file1 which contains <script type="text/javascript" src="/javascript/jquery-1.10.2.js"></script>
. Page has input fields. I enter some value in input field and click button. Jquery sends input to external php file.
2) external php file also contains jquery and in the external php file i also included <script type="text/javascript" src="/javascript/jquery-1.10.2.js"></script>
. Because if this i got the warning.
Removed <script type="text/javascript" src="/javascript/jquery-1.10.2.js"></script>
from external php file and works without the warning.
As i understand on loading the first file (file1), i load jquery-1.10.2.js
and as the page does not reloads (it sends data to external php file using jquery $.post
), then jquery-1.10.2.js
continue to exist. So not necessary again to load it.
In my particular case I was rendering a Rails partial without render layout: false
which was re-rendering the entire layout, including all of the scripts in the <head>
tag. Adding render layout: false
to the controller action fixed the problem.