In my website, I load some files and for example one of them is index.js
If I type in google https://mywebsite.com/index.js and then it shows the code of that javascript file.
How can I block this kind of actions and for example show a 404 page?
Thanks
Related
Below is the part of screenshot of mywebsite/index.php, a PC site with NO jQuery Mobile (JQM), with all scripts and styles.
Below the screenshot of mywebsite/mobile/options.php, a page designed to be run on mobile browsers, having JQM.
Here is the HTML script for Logout button, actually an ahchor tag:
Logout
.. refers to the main mywebsite folder out from mobile folder.
When I tap/click Logout, it should go to mywebsite/index.php, the PC site. And here's what shows up:
If I display the location using alert(document.location);, it shows - mywebsite/mobile/options.php.
I have to press F5 to view the page as it should.
I know that this is happening because JQM loads the pages AJAXually and hence ignores all scripts and stylesheets outside of BODY tag. I know this question is duplicate of many questions in StackOverflow and I have tried my level best to find a solution, but can't find one.
How do I move to the index.php without need to refresh?
You need to add additional code to your logout.php file to execute after the logout code executes. PHP headers can accomplish this. Within your PHP tags, add this to the end of your code:
header( 'Location: http://mywebsite/index.php' ) ;
I have designed a page using photoshop and illustrator for my product.Actually its the first page of our website, construction is not over yet.But I want to upload that one page to web now just for publicity.The thing is that i want to get that page open when the user types url in browser.
So, What i have to do to upload page to web and shows my page whenever the url is written in browser??Please help...
Is your page still in an image format or have you converted it to HTML?
If you have converted to HTML, upload it to your server and give the link of the HTML to users to check out the page.
It's not clear what your problem is but:
Register a domain with a provider
Name your html file index.html and upload it to the root folder of your web space.
This is my first Grails project & I can't seem to do this very simple thing! I am trying to display a list of PDF forms in one page that I have saved under a folder called forms under my_project/grails-app/views/forms and want to open the PDF form in a new window when clicked.
In my .gsp file I am trying to access the forms like this:
Form #1
But that's giving me a 404 error.
I have found couple of solutions like this one or this question (which is very similar to mine)...but first of all, i don't need to upload/download the file. Second, i don't need to render the file either. All I want to do is just click the link and open the PDF file in a new window/tab. Am I saving the PDF files in a wrong place? Please help!! Thank you.
Place your file/directory into grails-app/assets so that you have grails-app/assets/forms/form_one.pdf then you can use the resource tag like this:
Form #1
The grails-app/views directory is used for views rendered by controllers, where as the grails-app/assets directory is used for static and pre-processed assets.
I'm fairly new to jquery mobile, and am getting an error when trying to link a file in my jquery mobile project for download. I would like a user to be able to download a .zip file from the app, but get either a page loading error, or undefined displayed in a new page. I tried using an anchor tag to link the file to download, but it doesn't seem to work right. I know jquery mobile makes use of the anchor tag, so I don't know if there is something special that needs to be done. Any help?
You are likely getting the exception when jQuery Mobile assumes the link is a page and attempts an AJAX page load. Disable AJAX loading on the link.
Link
And I have no idea what the typical mobile browser will do with a link to zip file.
I don't understand how to navigate through an app with multiple .html files. All the examples that I've found have only one html file.
I have two files in my app :
index.html
artist.html
In my index.html, I use a Text, which works but does not add a state in the history.
From what I have read in the documentation, I should use a link like spotify:app:$APPNAME:arg. But I can't manage to make a link like this works to navigate from an html file to another. And because I can only find apps with one html, I'm wondering if all the existing apps only show and hide parts of an html file to simulate the navigation.
You can link internal with:
sp://appname/filename.ext
link to spotify:app:appname:test.
At this point in index.html you can redirect to the page you want (I.e. test.html) using:
location.href=sp.core.getArguments() + '.html'
The initial call to spotify:app:appname:test will be in the history.