javascript

"Access is denied" iFrame IE

Possible Duplicate: Permission Denied IE iFrame I have an iframe in b.com which attempts to grab the jQuery library from a.com [my website]. Whenever it does this I get the "Access is Denied" error in both IE7 and IE8. I have checked out Fiddler and it doesnt show that the script is getting blocked - but IE does errors with "...

How to customize the printing while using Window.print ?

i want to print a invoice and i use a print.css by media=print and when i change the current stylesheet to print.css i could able to view what i should be printing without the titles and content left aligned. But still while i'm printing there is space in the top and left and its taking up whole a4 sheet and also the whole width of the ...

Google Maps API and "rightclick" events on Macs

Note: This question is only based on Firefox. It may or may not apply to other browsers. Using the Google Maps API (v3), I can create a map and handle normal click events just fine, but when I want to handle rightclick events, it doesn't work on Macs. So, my question is how can you detect "rightclick" events from Macs with the Google ...

Reading Cookie from a different domain?

Can javascript read a cookie from a different domain?\ If i set a cookie in one domain say www.domain1.com. Can i read that cookie from a different domain www.domain2.com? If yes, how? ...

How to Get / Set Div and Table Width / Height

I have a Table (or a region) and want to set it's Width and Height value to another Div (or region). The second one is actually a Ajax Indicator modal which display a loading text when the page is asynchronously post back. here is the example <table id="MainTable"> <tr> <td> Content .... </td> </tr>...

Why does typeof null misbehave in switch statements?

It is commonly known that typeof null returns "object". However, I have a piece of code that looks like this: switch(typeof null){ case "object": 1; default: 3; } This code returns 3. Why does "object" as returned by typeof null not cause the first branch of the case statement to be executed? ...

javascript to print contents of only specific <div>

I have tried javascript window.print() It prints the full page content including the print button on the page. thanks in advance for any solution and help ...

Focus element inside iframe when iframe attached to Jquery Dialog

Hi, I have a iFrame which i load into jquery dialog. I want to focus an element inside the iFrame whenever the Jquery Dialog is being opened. Here is the code i am using to attach iframe to Dialog. $("<div id=\"srch" + options.winId + "\" title=\"" + options.windowTitle + "\" style=\"padding-left:0px;padding-right:0px;padding-top:0px...

html - selection range - getting the range + starting node + ending node + distance

From my previous question for selecting specific html text, I have gone through this link to understand range in html string. Actually I am confused here very much. My question is as follows. For selecting a specific text on html page. We need to follow this steps. assumed html <h4 id="entry1196"><a href="http://radar.oreilly.com...

Dynamic content in ExtJS Window

TLDR I want to add some dynamic content into an Ext-JS window / popup. Currently I have tried assigning this content to a div and pulling on the innerhtml of that div like: new Ext.Window({ height: 50, width: 160, x: 0, y: 30, layout: "fit...

Thrift JS compatibility with Cassandra (JSON Protocol)

I have generated a Thrift lib for Cassandra targeting JavaScript from the latest Thrift build in SVN. However, I noticed in the provided js thrift client library the following statement: This client can only speak the JSON Protocol and the only supported transport is AJAX. Does anyone know if the JSON protocol is compatible wi...

how do i display DropDown list on mouseover using Javascript

please suggesst me some code using pure javascript and html and css ...

Better way to find Class in event.target parentnodes using jquery and javascript?

Currently, I check the target of the input box keyup event to see if it is contained within a div wit class "editorRow" using: var $parentClass = event.target.parentNode.parentNode.parentNode.className; Is there a better way to do this in case extra markup is added between the div and the span tags? <div class="editorRow"> <li>...

JavaScript question related to the use of ' and "

my_window.document.write(' <script type="text/javascript"> function redirect(linkid) { opener.location.href=linkid; window.close(); } </script> <h1>Hello</h1> <p>Thank you.If you accidentally closed our website click <a href="javascript:redirect('http://google.com')"&gt;here&lt;/font&gt;&lt;/a&gt; to ...

Highlight current page in jquery

Hi, I have the 12 html pages. and all this pages are loads when the left navigation bar link clicked. in this, i need to add a class to the current link, which is clicked and loaded the page. i tried with this: $(function(){ $('#container li a').click(function(){ $('#container li a').removeClass('current'); var pat...

Pass a global javascript array value into a HTML Tag

Hi, Just wondering if it's possible to pass a global javascript array value into a html tag, specifically inside a img (title) tag? Basically want to know if I can do this: <img src="_info.gif" height="26" width="37" title=myArray[5]/> If so, how and if not, can people possibly provide other suggestions. Thanks ...

How do you hide an image tag based on an ajax response?

What is the correct jquery statement to replace the "//Needed magic" comments below so that the image tags are hidden or unhidden based on the AJAX responses? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> ...

IE layers issue when dtd with doctype tag is not added

Hello colleagues, I am facing a very strange issue because of which when i do not add the below line to the html the layers(z-index) is not working. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"; "_http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; Please let me know if you are aware of the issue and how to g...

How to handle Querystring in JavaScript?

Hi All, I have a js code: window.onload = function() { document.getElementById("Button1").onclick = function() { var t1 = document.getElementById("Text1").value; var t2 = document.getElementById("Text2").value; document.URL = 'myurl?t1=' + t1 + '&t2' + t2; } } Here i am add...

What is the best possible way to pass a Mulitline String as function argument?

What will be the Best practice to pass Multiline String as a Javascript function's argument. ...