iOS not updating JavaScript files - javascript

I was updating my internal website.
I have a folder that has images and a folder that has javascript files.
I was updating the javascript files on the server and testing on my desktop and everything was fine.
I went to look at the website on my iPhone and the updates weren't there.
I used web inspector on my mac to see what the issue is, when I went to the resources tab in the developer console and had a look at the js file it was the old one that didnt contain the changes. How do I force my iphone to get the new js file?

Clear your cache by going to Settings > Safari > Clear History & Website Data. This will remove all the history, cookies, and caches for web views (including Safari) on your device. If you'd rather not nuke everything, you can go to Settings > Safari > Advanced > Website Data and swipe left on a specific URL to delete all cookies and caches stored by that specific site

Related

Electron: localStorage on Windows is not working properly

Faced this situation:
The application uses localStorage to save user settings.
When saving, data is written to localStorage. I can even read them from there, everything is correct.
But at the same time, if you close the application window, and then open it again and log in as the same user, the data is not saved.
I see this error only on Windows (tested on Windows 10) and only when using Electron.
If I open the same application in a regular browser, the app works fine (saves and loads without any issues).
Everything also works fine on a Mac (both Electron and a regular browser).
Has anyone encountered similar behavior?
I would recommend treating an Electron app as a desktop application rather a web browser. Explore using node's file system API fs to store user settings.

Cordova/Ionic on Android, JS plugin files not arriving on device (seen via inspect device)

For android, some .js plugin files (eg for phonegap-facebook-plugin) are not arriving on device when I inspect device.
On iOS, I need to do “Target Membership” for that plugin, but on Android, there’s no such option.
I even try to include the file in my index.html, but it doesn't seem to get included.
Any ideas?
This is usually because of 2 reasons:
1) not doing exactly this: prepare -> refresh -> build
2) js error, as seen in inspect, causing old code to run

Displaying what is stored in the cache

I am currently making a web app and I have used a manifest file to get my web app to work offline. This works great and using Google Chrome, Opera etc I can view what is being cached by right clicking, inspecting the element and viewing the resources.
The problem I have is that I want to view what is stored in the cache in the app when it is being used on an i-pad. I have give this a Google but cant seem to find anything. Is there a way of displaying what is stored in the cache using some JavaScript or JQuery and then having this displayed on a web page within the app.
The app consists of a webview which is currently pulling in other html pages which are being stored in the cache using the manifest. I want to add a simple settings page where what is being stored in the cache can be viewed within the app. Hope that explains enough I would really appreciate any help with this matter.
I don't know of a way to get at this information with JavaScript either, but here are the alternatives I use.
In Mobile Safari, I connect the device to a Mac, open Safari on the Mac, open the site in Mobile Safari or open the native app going to the screen with the UIWebView, go back to the Mac and open the Develop menu. From there you can select the Storage option and view what's in the appcache.
In Chrome, you can view what's stored in the appcache using the URL chrome://appcache-internals/.
If the appcache was saved successfully, you could also simply go to the file itself in your browser.

iPhone Browser stops downloading resources to the HTML5 Cache when user navigates during the process

I'm working on a project using the HTML5 application cache to support an offline version of my application. When the user visits the application the first time, the browser automatically downloads all the files in the cache manifest file and saves them in the cache for offline use.
In Chrome, when the user navigates to a different URL (still within my application, which also references the cache manifest file), it will continue to download the files into the cache.
However, on iOS (I've tried iPhone, iPad, and iPod touch), if you navigate during the downloading progress, it seems to halt the process and subsequent pages do not download any files at all. In fact, the only way I can get it to restart the process of downloading files into the cache, I have to go into the Mobile Safari settings and clear the cache.
Am I doing something wrong? Or does the user actually have to wait on the same page until all the resources are cached (otherwise the cache is broken). It seems like there is maybe a bug in the implementation, but maybe someone has some experience with this problem?
Any chance you can post the content of your cache manifest? The first things I'd check are that (a) the relevant pages are listed in there, (b) the pages you navigate to have manifest attributes pointing to the cache file and (c) that you have an HTML5 doctype for each page.
You could try forcing a cache update programmatically too:
Safari Client-Side Storage and Offline Applications Programming Guide: Updating the Cache

Same Javascript code but not same act

//Edit
Hello.
I have made a website and uploaded to the host. So, the codes what are in my localhost and in the website host are same. Everything works except one JavaScript(jQuery) action(A dropdown menu). On my localhost it works perfect, on the website host, it drops and rises again and than doesn't drop again.
site : http://www.hastahakki.com/index.php?page=anasayfa
The problem on the big buttons like "Doğru Hastane Seçimi" , "Hasta Şikayetleri"
How do I do?
It's rare for pure client code to work differently in a hosted environment provided it is uploaded properly and the same browser is used.
First I would check it's not a cache issue by clearing my browser cache.
Then I would view it in a browser with modern developer tools, which is most browsers with the latest version (Firefox requires the excellent Firebug plugin). In Chrome for instance, looking at the Network output will show you if any resources are failing to load, and the Scripts view will show you any local JavaScript errors that might be triggered by the hosted version.

Categories

Resources