How to parse a html from different URL with JavaScript? [duplicate] - javascript

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Ways to circumvent the same-origin policy
Please help..
Mainly I want to parse a HTML from a different URL using JavaScript so I can find there if a class exists and I can show the result on my page if it exists or not.

I don't know your enviroment, but it looks like a jsonp :)
http://en.wikipedia.org/wiki/JSONP
1) You avoid same origin policy because You use src attribute of script tag.
2) You can have everything sent right into your callback function.

Related

How to pass a string which contain UTF-8 characters from javascript to PHP? [duplicate]

This question already has answers here:
UTF-8 all the way through
(13 answers)
How to store other languages (unicode) in cookies and get it back again
(1 answer)
Closed 5 years ago.
I'm building a references generator and I need to keep track of the generated references. To achieve this, I'm currently using Javascript to store a cookie containing the raw data, then a PHP page embedded on the result page takes the cookie and logs it into an HTML page, however, some characters appears like this : �. I really don't know which way to go to solve this (base64 encoding, unicode encoded characters...)
Here's the link to the website : http://louisfelixberthiaume.000webhostapp.com/source_siteweb.php
[It's in french]
I can't give you the link to the HTML page for obvious confidentiality reasons, however I'll provide a screenshot :
Generated references screenshot

Encrypt javascript file [duplicate]

This question already has answers here:
How can I hide or encrypt JavaScript code? [duplicate]
(7 answers)
Closed 4 years ago.
I don't find any info about that,so asking here.
Is somebody ever used some tool to protect javascript files? And totaly encrypt them?
Because I found this tool that seems like can totaly encrypt JS?
What do you think?
http://webtools.securitygeeks.net/p/blog-page_26.html?
That tool is useless. It declares a global variable called teksasli which contains your original script in a plain string. just look at the value of that variable in any console to see the original source.
There is no point in trying to encrypt Javascript, because the user/browser needs to decrypt it in order to run it.
If you want to obfuscate the source code, You could try GWT http://mojo.codehaus.org/gwt-maven-plugin/ (The Google Web Toolkit ).

how to encrypt html page source code using javascript functions [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to encrypt HTML, CSS and JavaScript to prevent theft
Please tell how to encrypt html page surce code for any webpage using javascript function if not possible then please tell alternative ways..
In order for the source to be rendered, it has to be decrypted in the browser and a DOM constructed, which which point the user can use a DOM inspector to access the DOM and serialize it back to HTML (thus creating a reasonable facsimile of the original HTML).
Thus there is no way, alternative or otherwise.

Is it possible to remove the 'cache' from the request headers with js? [duplicate]

This question already has answers here:
How do we control web page caching, across all browsers?
(29 answers)
PDF freezing browser - do I have enough information to isolate the cause?
Closed 8 years ago.
Basically, I need to remove the 'cache' part of request headers when requesting a particular static resource (a pdf).
Is this possible to achieve?
A bit more context:
I'm comparing two calls to a file (calls as in assigning the path of pdf to a src attribute of an iframe). One works, one doesn't. Using fiddler2 I've had a look at the traffic and it appears that the only difference is that the request headers of the request that doesn't work includes If-Modified-Since in the 'cache' part of it's headers. If I can remove this I think it'll solve the issues I'm having as I understand caching and iframes displaying pdfs can be potentially problematic. If I'm wrong, and it doesn't solve it, I'll at least have ruled that out as a problem.
EDIT: This is a problem exclusive to IE 8 if that's any help: https://stackoverflow.com/questions/13528332/pdf-freezing-browser-do-i-have-enough-information-to-isolate-the-cause
Like #Lee Taylor said, use a unique variable in your path. Mostly this is done with a timestamp since it's unique.

Retrieve the complete URL from an iFrame [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How do I get the current location of an iframe?
Hi i want to get the complete URL, and with the methods i know i get the full url but of the iframe, and i want the 'final' document.location.href,
how can i get it?
i don't care if its php or js, but i'm guessing by my experiments that with PHp it's not possible...
If you want to know where you currently are:
Client side - javascript - you can use alert(window.location).
Server side - php - .$_SERVER["REQUEST_URI"] or $_SERVER['PATH_INFO'] depending on what you want.
Take a look at the top answer from this question.
It's important to note that it's (luckily!) not possible to get the URL of an iframe if the iframe's URL is from a different domain than the parent page. If you're trying to do that, you're probably out of luck.

Categories

Resources