SP page deployed, but the content is old - javascript

I have a simple setup - SharePoint Foundation Server and Visual Studio 2013 Professional installed on this server. Everything worked fine. Until... I don't know why, but deployment stopped refreshing content on the page.
I have some javascript code on my page (inside aspx page or in external js file). When I change it (e.g. output sth else to console) I still see the effect of some previous build. It looks like deploy operation does nothing. The most puzzling part I think is when I click Debug button. One would expect it to work at least there. But it doesn't.
Two other developers working on the same environment (same server) have no problems with changing their JS code.
The only hint I have is this error msg:
0x80070005 - JavaScript runtime error: Access is denied.
I see it when I run Debug from VS. It is thrown at line if (!IsNullOrUndefined(window.localStorage) && IsNullOrUndefined(window.localStorage.SPAnimationEnabled)) of core.debug.js file from SP core.
Can anyone help me? I don't even know how to google it :s
Oh, I should also mention that I did clean and rebuild all but nothing helped. Also there are no errors thrown - either on VS output or in event viewer.

The project was under svn, so I fixed it by checking out to other directory. And it works just fine. I guess it had sth to do with permissions.

Related

How do I correct images not displaying error instead of loading correctly

The project can be found on Github. It uses Visual Studio 2015. It's a Javascript Windows Store Application designed as client web app that is for the wiki found at PadPedia.org.
To replicate my issue. Download the app. Launch in Visual Studio. Type "Module" into the search box to pull up an article. You will see "X"'s where the images should be loading.
In the Javascript Console I get an error in the following format:
The app couldn’t resolve ms-appx://gamepaduniverse.padpedia/w/images/thumb/4/4e/Left_Arrow.png/38px-Left_Arrow.png because of this error: RESOURCE_NOT_FOUND.
It makes sense that the error is RESOURCE_NOT_FOUND because it is going to the wrong address. It should be directed to appx://wiki.gamepaduniverse.com/w/... not appx://gamepaduniverse.padpedia/w/.... I can't seem to figure out how it's pulling the data together to arrive at that result.
It has to be an issue with the file: Default.js. In that file are the only strings containing "PadPedia" and "wiki.gamepaduniverse.com"
Can someone help me isolate this issue so the images appear on the article pages.
Update: I placed the wrong Github link. It has been updated.
Can someone give it a look? I am not familiar with how to debug using javascript in Visual Studio.

Logging properties of Node.js

I'm starting on a project using Node.js, and I'm running into some issues with it's logging. I'm completely new to Node.js, but my understanding is that using console.log([data]) should print out the value of [data] to the server console.
I see this occurring how I expect in several places in this project, but when I try to add additional logging, nothing is prompted out to the console window.
I've noticed that all of the files where logging is working are under a specific folder, while the bulk of the code is under another.
Does anybody know what might be the cause of these not to print out into the console? I've also tried console.error([data]) and console.warning([data]) to see if it might be due to an error but that also didn't work.
Without having your actual code, this is just a guess:
The files where the logging is working are the Javascript files for the server. The "bulk" of the code may be the client code (I guess so because you're saying in the comments of your post that you inserted a working alert, which is a browser thing), so your logs go to the browser not to the server.

Live Editing Remote JavaScript in Chrome Inspector

I'm trying to debug remote javaScript using Google Chrome inspector. I recall in the past being able to:
1) Edit remote javascript using Chrome Inspector
2) 'Save' the change using (cmd + s)
3) Test the effect the the altered javaScript on the page
Now when I try to 'save' the change I get a yellow warning icon in the 'tab' that says
"Changes to this file were not saved to the file system"
Can anyone help me with this, please bear in mind that I'm working with remote code (not trying to alter local files) and I do have the developer tools extension installed.
The changes were not saved to disk because you obviously can't access the remote js file, but they will take effect when javascript will reach to these lines of code.
You can add a breakpoint before the place you want to dynamically add your code, reload the page, add the code you want, click ctrl-s. Ignore the warning you mention about the file system and enjoy.
So you can follow these steps and just ignore the warning.
For anyone who stumbles across this, as I did...
For Local Files
You may need to run chrome as Administrator. Or in my case (Ubuntu) as root user.
sudo google-chrome --no-sandbox
Then you can save the files within devtools.
UPDATE: Per the link below, the docs have moved here.
You have to have Workspaces set up in order to do this. Read the docs on how to use Workspaces: https://developer.chrome.com/devtools/docs/workspaces

Javascript files won't load within Visual Studio ASP.NET 2.0 pro

I have just loaded an existing ASP.NET project into Visual Studio 2010 that is targeted at .NET 2.0. When I attempt to run it, the first page throws an error indicating that the JQuery file was not loaded ($ is undefined). If I paste the contents of the JQuery file within tags on the login page, everything works. This indicates to me that the JQuery file is not being loaded. I have verified that the path is correct.
This problem is not just with the JQuery file but with all JavaScript files, as far as I can tell.
I have copied this entire project directly from someone else's machine. It works perfectly on their machine. The project, on my computer, is at exactly the same path as on their machine.
If I go to IIS on my machine, and right-click on this application under Default Web Site, then choose Manage Application >> Browse, the application is displayed correctly in a browser. (I have verified that the virtual directory in IIS is pointing to my source code folder) So, it appears this issue is specific to the Visual Studio environment.
What could possibly be preventing the Javascript from loading. (the CSS files seem to be loading without error).
Thanks in advance for any debugging advice you can give me.
There can be many things wrong. Have you tried using Fiddler or FireBug and determined if the resources are requested? If they are what is the status that is being returned?
Is Visual Studio using IIS or the built-in Webserver?

Javascript not working on localhost, but it is working on Live site

I am facing JavaScript problems on XAMPP Localhost. The Collapse Buttons, go to top button and jQuery news feed are not working on every site on my localhost.
But Facebook, Twitter, Plusone buttons load correctly from remote server i.e. from the respective Social Sites.
So, I think it narrows me to the point that the JavaScript files hosted locally are not executed while those from Facebook etc. are getting executed.
I tried reinstalling XAMPP but didn't work.
I know this is old but, I had the same problem and found this question while searching a solution. But I have lampp installed on ubuntu and since Linux asks permission to execute ANYTHING, the local js files which resided in htdocs were without permission. After:
sudo chmod 777 -R /opt/lampp/htdocs
... everything was OK. Hope this helps future wanabee web developers.
It should not matter whether your files are local or not...javascript should still get executed. Try using some debugging tool like to see if you get any errors that only occur on your local machine. Because it could be that you are running some code that is depending on a domain or whatever.
I know this post is old and the answer is already given, I just wanted to give an answer of a possible reason that I encountered in case someone else finds this and it does not help.
Make sure your entire html code gets executed by viewing your page source. With me, half my code was not being executed due to a PHP error that was working on localhost with the local database but not on live with the live database. This caused the HTML to cut of from that point above my javascript.
So check your page source. If it is being cut of somewhere, find out why :)
I had the same problem. I try a lot but finally solved. The main problem was my browser cache that prevents from loading the new JavaScript file. My recommendation is that clear your browser cache data then close the browser and reopen your site again it will work perfectly.
remove any (pre in post ) blank spaces from filenames of your namespace example : localhost:port/dir /index.html
localhost:port/dir/index.html
In similar cases,
If web project site runs JS on Live Server but not on locally opened index.html,
try to check validity of HTML File Paths,
e.g you may have written:
<script src="script.js"></script>
instead of:
<script src="./script.js"></script>
Try to add ./ before file name.
./ means Current directory.

Categories

Resources