Javascript for Google Chrome detecting & Enable javascript in Google Chrome - asp.net

My application's JavaScript is working on Firefox and IE but it is not working in Google Chrome. Is it problem of enable javascript in Google chrome? or I must put any code in javascript for getting XMLHttpRequest Object of Google chrome browser.

If the code works in two other browsers but not in Chrome, you need to look at the code for your "ajaxFunction" because that is apparently what is giving Chrome a headache. As #Artem mentioned, Ctrl+Shift+J will bring up the Javascript Console (switch it to the "Scripts" tab) and you can easily examine any errors.

Google Chrome's Javascript engine interprets JS very similarly to the other browsers mentioned. What is it that doesn't appear to be working?

There is a Javascript Console in Chrome, press Ctrl+Shift+J to open it and check for errors.

Is this question related to this problem? Problem could be that .NET thinks you're using the Safari Browser instead of Chrome...

Related

Browser issues : How do I check what is being sent to page (IE version 10)

I have an ASP.net website that was working fine with IE9, Mozilla, chrome but with IE 10 users have lot issues. The UI and even the functionality (like clicking on button, login/logout do not work) doesn't work well with IE10.
The IE version I have is 10.0.9200.16519.
I see few differences between the view source from IE10 and google-chrome (or even IE9) but can't understand much of it.
Where actually in the site can I check why pages sent to IE 10 browser is different from others browser or IE9?
Please suggest how can I debug further?
PS: The site works fine with IE9 and below versions of IE.
ASP.NET fails to identify IE10's user-agent string, and as a result can send back broken code. This has been discussed in various places, but probably most notably on Scott Hanselman's blog. See the post titled Bug and Fix: ASP.NET fails to detect IE10 causing _doPostBack is undefined JavaScript error or maintain FF5 scrollbar position.
check if there is any js error, use IE developer toolbar (F12) to debug script

css fix for chrome, and other web browsers

I am looking for a fix for styling a webpage that so that a webpage on google chrome, will look the same as it does on firefox, meaning, is there some syntax in css to make all of the web browsers look the same. does this exist (I would also like one for I.E., and any other web browser if it exists if it exists)
Google Chrome uses a different rendering engine than Internet Explorer/Firefox, so may display web pages differently. Apple Safari uses the same rendering engine as Google Chrome (WebKit) and should display pages the same way.
If your site isn't rendering properly in any browser, make sure your HTML and CSS are valid by testing them at http://validator.w3.org/.
If your site doesn't render properly in Google Chrome or Apple Safari, file a bug at webkit.org as described at http://webkit.org/quality/reporting.html.
If your site renders properly in Apple Safari but not in Google Chrome, please file a bug against Google Chrome at http://code.google.com/p/chromium/issues/list.
How can I test my website in Google Chrome?
There are several tools to help you test your website in Google Chrome:
Web Inspector
Right-click on any component on a web page to launch the web inspector. You'll be able to see the elements and resources associated with the component on which you clicked, including a hierarchy view of the DOM and a JavaScript console.
Task Manager
Select the Page menu icon, then Developer > Task Manager (or press Shift+Esc). The task manager shows all running Google Chrome processes, and the resources that they're using (memory, CPU, and network).
JavaScript Debugger
Select the Page menu icon, then Developer > Debug JavaScript. This launches a JavaScript debugger that can be used to attach to existing processes.
I found the Answer. Being that I am using drupal, there is a built in IE fix for the theme that I am using (fusion) that creates separate css files (ie7.css, ie8.css, etc). using these, I can adjust what I need for IE specifically.
Most layout problems with decent browsers are cause by invalid HTML, invalid CSS, or misunderstanding what a particular piece of CSS is actually supposed to do.
In general, when I see a difference between FF and Chrome, it is because Chrome is doing the proper thing and FF just happens to be rendering some invalid CSS fine. 99% of the time, I can fix the CSS and get FF and Chrome to render the same.
The remaining times, I typically browser sniff and use jQuery to fix the problem.

How to debug css in IE?

Is there a way to debug a css file in IE? I wish to see if a particular background-image is loaded or not.
This is in reference to the question:
extjs gridfilter icon not showing in IE but shows in Firefox
Or for any version of IE, try FireBug Lite. You can simply bookmark the link given on that page (bookmarklet) and then, to open a FireBug like thingy whilst on IE, simply click on the bookmark you just added.
Use the built in browser troubleshooting tool (aka Developer Toolbar) by pressing F12.
It is built into IE8 and later, but you can download and install it in earlier versions.
Do you want to target IE specifically in your CSS? If so I wrote a blog post about this not so long ago, please have a read: http://ajthomas.co.uk/blog/?p=299.

What tools exist for tracking down IE7 javascript problems?

I am trying to debug a large and complex webapp that makes heavy use of DIVs, AJAX, dynamic HTML and server-side code to do its job.
Under normal operation we do not have problems. However, when we put the webapp into an IFRAME, certain functions trigger a crash in IE7 that renders the browser inoperable (all CPU used).
What tools exist to help track down what could be happening? Loading the IE process into the debugger gives me all sorts of fascinating info about the registers, but I think the issue is in javascript.
We have tracked down one problem with the app already that involved incorrect reparenting of an element (something attached itself to window. instead of document.)
I wrote a test IFRAME page that dumps the innerHTML of the iframe into a textarea, so it can be compared during various states, but that only shows me static attributes, I can't tell what sort of javascript events are associated with elements or determine if a handler is firing out of turn.
IE8, Firefox, Chrome etc do not have the same behaviour.
Ideally I'd like something that would let me snapshot the DOM (or the javascript VM?) during a known good state, then "just before it happens" so we can figure out what's added / removed / missing / different. What is out there?
Update: I'm now trying to use the IE Developer Toolbar to track it down.
Update 2: The IE7 crash occurs following this AJAX code:
function Sys$UI$Control$get_element() {
/// <value domElement="true" locid="P:J#Sys.UI.Control.element"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._element;
}
The return this._element; line is the last thing that happens before I lose IE.
IE Developer's Toolbar. Download it here (IEDevToolBarSetup.msi).
For JavaScript debugging refer this blog.
Some guy made a bundle that's called Internet Explorer Collection. It includes some 6 different IE browsers ranging from IE6 to IE8 in different builds. All those include Firebug (really, it sort of works) and Internet Explorer Developer Toolbar.
It was really helpful for me to debug IE7 issues.
see this link.
By placing 'debugger' in the javascript files in places where you'd like to start debugging you can debug the javascript in visual studio as well complete with trace, call stacks, etcetera.
The IE developer toolbar definitely helps alot. Visual Studios's debugger is also very good if you can get a machine with VS and IE7 on it.
DynaTrace is a profiling tool for IE7. However, it provides a great deal of information (including JS stacks), so it can also be very helpful for debugging.
IE 7 and IE 8 has built in debugging tools. Press F12 and you are ready to debug. Also firebug-firefox and chrome's inspect element options are useful/

Why does the following flash not initially load in firefox, but works in chrome and IE

The following flash does not initially load in firefox, but if I click the second tab on the right, and then go back to the first, it loads. This works in Chrome and IE. Here is the webpage.
This is odd, normally things dont work in IE but do in Chrome and Firefox. Upgrade your Flash Player is my advice
Have you ruled out the possibility of it being a browser problem and not related to the site?
Does Firefox do this for any other sites?
Try clearing you cache and upgrading your Flash plugin to rule out the browser.
At a guess, a timing issue. Flash doesn't keep a network stack, it merely passes network calls to the browser, so any kind of logic that is sensitive to the timing or order of loads, load events, etc., can function differently from browser to browser.
But it's impossible to say more without seeing some code.

Resources