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

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.

Related

Is it possible to create URL that links to a location in the Chrome DevTools?

While in dev-mode in my application, I would like to be able to have links on the page that automatically take me to a specific file in the Chrome Dev Tools.
Is there any way to generate a URL that when clicked in Chrome, opens the Dev Tools at the Sources tab and at the desired file ?
You are able to "inspect the inspector": How do you inspect the web inspector in Chrome?
Simply undock it, then inspect DevTools itself with ctrl+shift+i. Then head on over to the sources tab in original (first DevTools), inspect it, and get its URI from Elements.
Or use chrome://inspect/#other
Example URI (first part only):
devtools://devtools/bundled/toolbox.html?remoteBase=https://chrome-devtools-frontend.appspot.com/ser…
Your requirement is somewhat specific, so I don't think it is possible (at least not natively).
You probably can achieve what you want extending DevTools with an Extension (see the documentation). This way, you can make your page interact with the extension to make it open a specific panel in Chrome Dev Tools.

In the Chrome Devtools, is there a faster way to open "inspect devices" other than using the mouse?

I would love it if there was a hotkey, or some other method I could use to avoid having to use the mouse to constantly re-open this window whenever I redeploy my app.
Alternatively, is there a way of re-using an opened device inspector window that I'm unaware of?
chrome://inspect URL can be a good option.
But, what IS chrome://inspect? Well that's a global development tools page. It opens on the "Devices" tab by default, so that's handy.
I searched for a keyboard shortcut, but sadly I didn't discover any.
You could bookmark chrome://inspect and put a shortcut on your desktop by the way (except for Chromebooks, which is what I wrote my answer with)
From there, you can jump to inspection of any open page in your Chrome browser, which is nice too.
Alternative: When undocked, the Inspector will have the Console in the bottom. Well on the bar above the console, the leftmost three-dot menu has a direct "Devices Inspector" option.
I use os x and use Cmd+Opt+I Hotkeys to open Inspector in chrome.
You can find more hotkeys here
Hope this helps
Thanks

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 do you inspect the web inspector in Chrome?

According to Google this can be accomplished by visiting "chrome-devtools://devtools/devtools.html" in Chrome but now visiting that page in the stable version of Chrome (or Canary), just shows a 99% stripped version of the inspector.
To reiterate my "title" this is in reference to "inspecting" the inspector. Not just inspecting a normal webpage.
And while I don't think it's necessary to know to resolve the issue, I"m inspecting the inspector so I can style it as discussed by Paul Irish and here: https://darcyclarke.me/articles/development/skin-your-chrome-inspector/
Follow these easy steps!
Press Command+Option+i (Ctrl+Shift+i on Windows) to open DevTools.
Make sure that the developer tools are undocked into a new window. You may have to undock from the menu:
Press Command+Option+i again on this new window.
That will open the DevTools on the DevTools.
You can redock the page's DevTools if you want.
If it's not already, select Elements — it's the first icon at the top of the inspector.
A little beyond the scope of your question, but still valid in understanding why you're experiencing your problem can be found by understanding how Chrome Developer Tools: Remote Debugging works.
Open chrome://inspect
Open the inspector on that page (cmd + alt + i)
Scroll to the bottom of the page, under the Other section click the inspect link
The URL in the Other section should look something like this:
chrome-devtools://devtools/devtools.html?docked=true&dockSide=bottom&toolbarColor=rgba(230,230,230,1…
EDIT: they've fancied up the chrome:inspect page so you have to click the Other header on the left to get this to work now.
I just got this to work. The key is that you have to start up chrome in 'Remote Debugging' mode.
on OSX, open an terminal window and execute the following:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
On windows, Its
chrome.exe --remote-debugging-port=9222
(better windows instructions can be found here: https://developers.google.com/chrome-developer-tools/docs/remote-debugging#remote)
This will start up an instance of chrome, that will send debugging messages to a local webserver on port 9222.
If you access that web service, it will give you the ability to use the inspector to inspect any chrome window that is running. Since we want to inspect the inspector, we need to start an inspector window first (As above Use the shortcut keys; for Mac it's Command+option+i.)
Now, go ahead and navigate to
http://localhost:9222
It will present you with a list of windows to display in the debugger. Select the window that starts with "Developer Tools" and you'll be able to inspect the css for the inspector.
Its hard to see in the image below, but on the left I have my chrome window pointing at the remote debugger, highlighting one of the toolbar labels. On the right you see it lit up with the tooltip just as if we were debugging a web page.
A few weeks ago somebody pointed this out in stackoverflow's "javscript" chatroom. First, and very importantly, make sure the inspector is undocked from your browser window. Then it's just a matter of opening a inspector window and then inspecting that window. In windows it's CtrlShiftI (Edit: I said, CtrlShiftI but that brings up the console inspecting the console... you should be able to navigate back and forth.) for the keyboard shortcut. (Other keyboard combos for other options and OSes here and here.) Just do that twice and you're good.
Edit: ok, you're probably confused as to undock the window. This is what you'd click if it's docked..
Edit II: I'm not quite sure why you can't inspect. JDavis's answer is consistent with the Google Docs for Apple computers. If you're using Linux it appears to be the same as Windows. You supposed to hit the inspector key combination while the focus is over the inspector window.

GWT - How can I see the HTML code?

Im using netbeans and the framework GWT. Due to the GWT structure, on my browser i can't see the html code with the simple "View Source". How can I see this? Im using Google Chrome.
Bye
View Source only shows you the HTML page that was downloaded (i.e., not much). Try using Chrome's Developer Tools to see the DOM structure after GWT's loaded. You can also use it to see network traffic from the page, and see JS errors if there are any.
I was faced with exactly the same situation. I use the Firefox extension Web Developer: on the "View Source" menu there is an option "View Generated Source".