Mock tests, Interview questions, Tutorials and Tech news
 
 

Archive

Posts Tagged ‘chrome’

Chrome browser not showing google ads for xhtml file

May 25th, 2011 Vinay No comments

We we migrated from JSF1.0 to  JSF 2.0 ,  we had to convert the files to .After this change, it was found that the  google ads were not  displayed in chrome browser although the same code worked on Firefox and IE.

for eg if you have this code and save it as ,xhtml file , the ads will not be displayed

<html xmlns=”http://www.w3.org/1999/xhtml”>

<body>

<script language=”javascript”>

google_ad_client = “pub-494222175576702985″;

google_ad_slot = “00987428928″;

google_ad_width = 728;

google_ad_height = 90;

</script>

<script language=”javascript”

src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>

</script>

</body>

</html>

</html>

<html xmlns=”http://www.w3.org/1999/xhtml”><body><script language=”javascript”>

google_ad_client = “pub-494222175576702985″; google_ad_slot = “00987428928″;

google_ad_width = 728; google_ad_height = 90;

</script> <script language=”javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>

</script>

</body>

The reason being that google js file uses document.write, which is not allowed in a application/xhtml+xml page. As per W3C Read more…

Categories: Programming / tutorials Tags: ,

Examining Http Header Information in Google Chrome

March 20th, 2011 Vinay No comments

Some time you would like to see the header information being returned by your response.

This is really useful when are playing with cache header and response.  It was pretty easy in Firefox when you have the firebug installed but in Google Chrome , it is a little tricky.

To view the header in Google Chrome, go to

Developer tools or Ctrl + Shift +I , Click on Resources , select the path on left and then select headers

Debugging in Google Chrome

December 13th, 2010 Vinay No comments

For those of you who had been using firebug with Firefox and IE, if you had would have tried to work with Firebug in Google chrome, it might have not worked perfectly. In some of last posts, I had talked about firebug and its usefulness as a debugging tool.

Chrome the latest browser from Google, has got some very helpful debugging tools built in. Here is a look at how to take advantage of it. Open your site in google chrome.

One you are on web page you would debug, click Ctrl + Shift + J. You will see a new window open up

Debug window in Chrome

Debug window in Chrome

Now you can set up the break points on the code you want to debug and there you go.

You can change the values of variable (very much you do in eclipse) and can see the results.

Categories: Programming / tutorials Tags:

Button not disabled in Firefox and Chrome

August 29th, 2010 Vinay 2 comments

When you try to disable any button in your web application using this javascript function

document.getElementById(‘buttonId’).disabled=true;

You may find that it will work in IE but on Firefox and Chrome.

Reason:

From W3Scholl,

“Enabled” Property isn’t standard property of XHTML 4(It’s Microsoft standard.).

So the solution would be to add this piece of code

var obj = document.getElementById(‘buttonId”);
getLabel = function(elem){
if (elem.id && elem.id==”label”) {
elem.id = “disabledLabel”;
}
};
Dom.getElementsBy(getLabel ,’td’, obj);

Get Adobe Flash playerPlugin by wpburn.com wordpress themes