Chrome doesnt display sourcecode that was added via Ajax - google-chrome

I am using Google Chrome to test my Webapplication. With Control-U you can see the sourcecode of a page.
However it does not display the html/css that was added by ajax or that was created by jQuery. How can I make sure that I see all sourcecode?

You can view the created source using the developer tools.
On windows press Ctrl + Shift + J,
Click on the elements tab and there is is.
You can also do a bunch of other stuff too.

Try using the javascript inspector, similar to tools such as firebug in firefox. You can right click on an element and select "Inspect Element" to open it on that element. It should show you what was already there and what's been added through ajax.

You can serialize the document with XMLSerializer (Firefox, Chrome and Opera maybe IE (cannot test))
see this Fiddle

View Source doesn't work the same in Chrome as it does in some other browsers -- when chosen, it redownloads the page and displays the resulting HTML, rather than displaying the HTML that was used for the current page.

Related

code tag shows XML markup then disappears in Chrome

The below URL shows some XML in a <code> tag. It works fine in say Edge and Firefox but in Chrome, the markeup shows for a second then disappears just leaving the values as you can see below. Why is this happening in Chrome?
https://basketball.exposureevents.com/api/resources/venues
First, try hard refresh, it's simple thing that may solve the problem (if the source of it is in the specific site's CSS/JS code) (Windows: Ctrl+F5, Mac: Cmd+Shift+R)
Second, try update you'r Chrome to the last version (70.0.3538.67), go to on the top bar, there you can see if there is a new update (if there is, it will show up at the first line).
You can check you'r Chrome's version in this link: chrome://settings/help or go to on the top bar > Help > About Google Chrome.
If you'r Chrome is up to date, you may have some plugin/s that removing the xml tags.
Try accessing to this page via Incognito Mode (Windows: Ctrl+Shift+N, Mac: Cmd+Shift+N).
If it's working in the Incognito Mode, back to you'r main Chrome and then click on on the top bar > More tools > Extensions. Then, disable all of them and try to enable them one-by-one, on each one you'r enabled, go and check again if the problem is still there.
*Note that some plugins may be enabled also for Incognito Mode, so try the last step anyway.
Update: As much as I understand, the root issue is that your code was wrapped with html <pre> tag, that makes the browser to treat the XML as HTML tags, that are invisible when rendered in browser.

Google Chrome Element Inspector (Developer Tools) removes HTML element in my page

I am using WordPress and on the admin side when I use Google Chrome v.32 Element Inspector (Developer Tools) some of the elements in my HTML seems to be removed. But when I load my page without the Developer Tools all my elements are there.
I did not have this problem with the previous version of Google Chrome.
I cannot post the code here, first because it's way to long and second I am not allowed. But maybe others have experienced the same problem and others might even have the solution.
I know it is not my JavaScript because it is not even downloaded the script elements have been removed for some reason because of the Developer Tools being open.
Basically why when I have the Developer Tools open for a page that page as some of it's elements removed and when I re-load the page without Developer Tools everything is back to normal?
My bad. For some reason the emulator was open. And set like this:
All I had to do is unchecked "Spoof user agent".

How can I see the coded results of a $('#x').html(.....) call?

The browser renders my changes properly for that function, but I cannot see the source when I use the
"view source" menu item. How can I see the changed source HTML?
This is browser-specific, but a debugging console (Firebug, etc.) will do this.
"View generated source" in the Web Developer Toolbar for Firefox will open a view-source like view of the current page source.
Most modern browsers have debuggers and dev tools available as addons or built-in.
Chrome and IE8 has it built-in although it's not in the right-click context menu on IE8 and is instead in 'Tools' or you can hit F12.
On Firefox you can install Firebug.
Usually what you're looking for isn't available through 'view source' but instead use 'Inspect Element'.
You'll probably find a lot of your debugging work is done in the script debugger and exploring in the DOM.

View real HTML source in browser

I lookong for some IE or Firefox extension, which allows to browse html source, corresponding to data, shown in browser window right now.
I have large web application with alot of code, generated by JavaScript. I need to extract real HTML code, which I see in browser window right now (View source function shows only code loaded from server, not generated by JS). Most of JavaScript debuggers can show DOM model from browser memory, but I'am need something more friendly, like printable HTML. Does anybody know tools or plugins for IE (preferred) or Firefox?
Firefox's Web Developer extension will allow you to do this. After you install it, just select View Source->View Generated Source.
FireBug for Firefox will display the HTML corresponding to what you see in the browser window right now (that is including any modifications made in JavaScript).
You can use
javascript:document.write("<xmp>"+document.documentElement.innerHTML+"</xmp>");
in IE to view the generated source.
Paste the above and execute in address bar of IE.

html - how do I make a page load in a new tab in IE8?

What combination of html and IE8 settings get IE8 to open links in a new tab. Or can you not do this with IE8, and you only get the new tabs by manually selecting File-> new/duplicate tab?
My website works in Firefox - pages on the site load in the current tab, and links off site load a new tab. IE8 won't behave: target="_blank" opens a whole new window; the other options, _self _top _parent, all open the page in the current tab.
I have Firefox set to "Open new windows in a new tab." The links to pages on my site all have target="_self" and Firefox keeps these in the current tab. On the external links I don't have a target set (I added _blank to see if it fixed IE8, and doing that didn't affect Firefox).
I can't find an equivalent setting in IE8. Tools-Internet Options-General-Tabs/Settings has an enable tabs box, and a sub-option to automatically switch to newly opened tabs. Is there some html that will work? An IE8 setting I'm missing?
Any help appreciated.
It is not a thing you can control from HTML code, as it should be user's, not document author's decision how to open a link.
To open pop-up windows in new tab, follow instructions from IE8 help:
To change how pop-ups are displayed
In Internet Explorer, click the Tools
button, and then click Internet
Options. Click the General tab, and
then, in the Tabs section, click
Settings. Make a selection in the
When a pop-up is encountered section.
Click OK twice.
Updated:
Reading OPs comments to other posts, it seems like the intent is to make all external links open in new tabs. However, it is not document author's choice how the client should open any link in any page - it has to be decided by the client. Moreover, even though you can create a client-side script which sets "target" property to open pop-up windows, there is no notion of "tab" in Document Object Model and hence you cannot do it even in a script.
The answer to the question was posted in the comments (but is now deleted). Now you can test it in IE8 - just use the middle mouse button to open the link in a new tab. Firefox does work better with tabs.
How the browser interprets the target is browser dependent - each vendor will specify what they want. Firefox decided to use a new tab, IE decided to use a new window.
The html 4.01 spec has this to say on "_blank":
The user agent should load the designated document in a new, unnamed window.
The spec predates the wide usage tabbed browsing now has, so doesn't mention the concept anywhere.
Opening a page in a new tab is concept that believe is not covered by the html standard. The Firefox behavior is just a setting in the browser, which IE8 might or might not have.
On a related note, I personally find it abusive of websites to make the choice of opening a page in a new tab/window. What if I want it to open in the current tab/window?
Of course, in a rich application-like site that is basically entirely an application I find it convenient that pages open in a new tab/window. This makes them work more like desktop apps
For normal pages, I would suggest not setting the target at all and let the user decide.
I think W3.org is still working on this issue, but it isn't implemented in any browser yet. Also remember that Internet Explorer will be the last browser to implement it ;)
This is code copied from a W3 Working Draft:
/* If a user wanted to have new windows open in new tabs instead, she could use the following user style sheet to do so: */
* { target-new: tab ! important }
Of course, it is impossible to set user preference in HTML or Javascript -- it would be unsafe.