Get source code instead iframe - html

How I can get source code of iframe but to show all web site code who is in iframe when I click in my browser (right click/source code)...
Here is my code: http://jsfiddle.net/XWgnU/
UPDATE: What I'm need is to put URL in text field enter Submit and show the page with they source code below. Is it possible?

You can't run JavaScript on a third party page loaded in my browser, with my cookies, my ip address and anything else that site might use to authenticate me.

Related

I have a web page. I want to show blank page when user tries to see the source code of the web page. How can I do it?

I have a web page. I want to show the blank page when the user tries to see the source code of the web page. How can I do it?
When a user views a webpage in a browser, they are viewing the sourcecode - it is just being rendered by the browser differently than a text editor would render it. So the only way to have the source code be hidden from the user is not to show it to them. So have your website serve HTTP responses with no content. In php, this would be:
<?php exit; ?>

How to view HTML source without refreshing the page in Chrome

I need to view all source HTML in plain text in one place. I need it from an already loaded page. CTRL+U (View Source) refreshes the page. The page I'm trying to view can only be accessed via proper form submit. What I really want is for CTRL+U to not refresh the page.
I need the HTML source of an already loaded page added to my clipboard.
I think none of the other answers really answer your question.
You want the exact response from the server, not the current DOM, and you want it with the exact request headers that was sent the first time.
To do so, open the Chrome Dev Tools and select the "Network" tab.
The very first request should be the page you requested. Click it and select the tab "Response" on the right side to get the exact response the server gave you.
Right click-> inspect element anywhere you want to see the html, it still show the code of all the page ans you can modify the value of html/css directly in it.
The only answer is the one Dor1000 provided himself in a comment:
dev tools, elements tab, right click html tag, copy, copy outer html.
He wants the current HTML (after javascript or any other modifications, not the original source HTML).

How to return an image through asmx web service and show in html page

I want to return image(s) through asmx webservice and show them in a html page.
I should not images are located in a folder named by numbers (1.jpg, 2.jpg and etc.) on server and also I should note that I don't want to make and use url for each image because it may cause security issues for me.
I have a textbox in my html page with a submit button and I want to see "1.jpg" in my html page when I insert 1 in textbox and press submit button.
Please help me to play out.
I have a textbox in my html page with a submit button and I want to see "1.jpg" in my html page when I insert 1 in textbox and press submit button.
Simply return the image data from your service along with the appropriate Content-Type header, such as image/jpeg. Then, use JavaScript to create an img element that references your service:
<img src="images.asmx?image=1.jpg" />
I don't want to make and use url for each image because it may cause security issues for me.
I don't know what security issues you're referring to, but just because you can access these images via script doesn't make them secure. Anyone can access them this way unless you take steps to prevent it. It's no different than simply changing the URL.

Is there any way to request a page without displaying it?

If you link to something downloadable with a simple <a href, the user will download the file while staying on the current page. You can get this behavior with files that the browser has no plugin for (like .bin), or by sending a content-disposition header to force downloading.
Is there any method or header which keeps the user on the current page while still requesting the page? The idea is that the user clicks a link, the request is made, but the page doesn't change—like when downloading a file.
This could be done with an iframe I guess, which is not really pretty and makes another request when loading the page. Javascript is another obvious answer, but that's actually the reason for asking this question: compatibility with JS-less clients.
A form with the method set to HEAD is another ugly solution, but doesn't work anyway. Chromium ignores the method and simply performs a GET request...
Anymore ideas?
You could place an iframe on your page that is hidden. Then, give that iframe and id.
Use this id as the target of a link to the file you want to pull down.
I've created a demo at http://jsfiddle.net/dancrumb/N87nL/ to show you how this would work. Just style the iframe as being invisible and you're good to go
The page will load in the iframe, you'll stay on your page, it doesn't require JS. Oh boy!
Note that the iFrame doesn't have an initial value for src, so no request is made on page load.

HTML page shows up as "view source" when pressing "back" in browser

I have this strange error - the page on the site will sometime show up as source (e.g. pure html) when the "back" button is pressed..
This is happening with Rails app..
Any ideas why that would be happening?
Thanks
it happens with Passenger. If I go to the page, then press back and then forward I get the source..
I am not sure what you mean by ajax sudo navigation.. there is a script which checks through ajax the contents of the controller (and depending on results renders the page), otherwise it is classic MVC.. model/show/ etc..
please let me know if I need to add some more info.. thanks!