I'm working on a web project using Grails 2.3.7.
Every time I change any Javascript file and refresh the page, I've get direct to a blank page with the following message:
"Resources are being processed, please wait..."
After some research, I discover that have something to do with the "DevModeSanityFilter.groovy".
Can anyone give a help so a can change the JS file and see the changes without this message and without restarting the server?
Remove the abandoned and deprecated resources plugin from your BuildConfig.groovy and use the asset-pipeline plugin instead. asset-pipeline uses a much better approach to resource handling and is actively developed.
Related
So I am trying to download a complete HTML page in a React-Native app , so that the user can view the page later when they are offline too. I am rendering the page using WebView and it works without any issues when online.
For getting it offline, I am doing a axios.get to fetch the page and I'm storing it. But when I'm rendering this page I noticed that its missing all the css/images since, they were not part of the GET request. How can I download the complete HTML page and render it as it were online?
I'm not able to think of any way to download all the page's assets.
You need to download all referenced assets and possibly change references so they work locally. There are a few tools that can do this.
The simplest way is probably by saving the website using your web browser. This may or may not work the way you expect but it’s worth trying.
If it’s not enough, try tools like HTTrack or wget. Instructions here.
it similiar with my current issue, im facing with long time download aset time when user try to open the webview, its reduce UX anyway, then we should do something for better performace, and i found this package
https://www.npmjs.com/package/react-native-static-server
but i worry about the long term maintenance of this package, if the package some day not updating their package when react native updating their library, ist gonna be worst scenario.
I have made a project whose structure is like this
When I run my index.html from firefox, it is working fine.
But I open it with my chrome it is giving CORS error.
Now my problem is that chrome doesnot support file:// protocol ajax request & as I have distribute to my project to others I don't want other to run on firefox only.
Internally I am using ajax call in project, to load the resources. Can Somebody suggest how to bypass that ajax call to load resources?? Is there some solution or any third party js which can help me.
Note: Please don't suggest to use XAMPP, apache etc where I can put my project and run as localhost for chrome as I don't want user to force to download these to run my project. Please give other useful solution where I can do some change in code & it works for everyone.
Here are the links from which you could understand my problem better.
Ajax in Jquery does not work from local file
AJAX code do not run locally
AJAX request using jQuery does not work
Embed the data directly into the JavaScript or HTML and read it from there.
The data isn't going to be changing based on user input or the contents of a database, so having it in a separate "http" resource doesn't bring huge benefits.
If you want to store the data in XML to make it easier to edit in your development environment, then write a build tool to bundle it up into an embedded format before distributing.
Title pretty much says it all. Your help is greatly appreciated. I'm so happy that I just got the JavaScript to show up in the first place, now only if it actually updated when I changed it, I can actually starting using JavaScript effectively in my portal project.
Help is MUCH appreciated!!!
If you running your project from JDeveloper directly its supported just out of box, change your files and reload. Don't forget about browser cache.
Use OHS in front of your weblogic server and setup location for serving static files. Update as you do it with regular web server.
Quick and dirty (only for debugging/development stage). Embed your script in adf page using <af:resource> component.
We are developing a third party java script file that is implemented as a widget on many sites (That we do not control the code of).
This script may be updated from time to time (As we modify it/ add abilities/ fix bug ...)
As the browser saves most js files in cache, we need to have some sort of solution to tell the browser to reload the Script. of course a naive solution is to make re-load always, but this solution is not very efficient, and code changes should not accrue often.
Any idea how this can be done?
The solution of changing our script src/url with "?version=1.1.1" cannot be applied here as this widget is third party and we do not have any control on clients website codes.
Thanks.
Since you are the 3rd party and are giving your clients a link to the javascript file they need to include, have them point at your javascript with a url like this:
http://example.com/file.js
Then use a redirect on your server (Url Rewrite/htaccess etc) to point them to the latest version of that file. Lets say you versioned your script by putting it into a folder and your latest version was 1.3. You would setup the redirect from http://example.com/file.js to http://example.com/1.3/file.js. Then every time you release a new version, update your redirect to point to the new folder.
EDIT: More detailed explanation
Since implementing Cloudflare some of my includes aren't working.
One specific example: Inside the includes folder, I have a sub folder "texter". Here I have a php page that references a Javascript library in the same folder. The page receives a GET request with variables, then parses on the parameters to an external 3rd party API.
When Cloudflare is disabled/paused the mini app works.
I'm using Page Rules to disable Cloudflare activity for my includes folder but it's still not working.
e.g. Pattern: *mysite.com/includes/* - With all rules and chache set to disabled.
How can I get my web app running while Cloudflare is also running? Am I on the right track? Thanks in advance.
Edit: I'm using htaccess to limit direct access to these directories... could this cause an issue?
Hmmm...this goes away with us paused? Do you have something like Rocket Loader turned on in your performance settings (can potentially impact jQuery or JavaScript).
Do any error messages appear at all?