javascript

DOM javascript Navigation

I want to unhide the hidden divCommentBody div that belongs to the "checked" checkbox, but can't find it using javascript. This is javascript function: function ExpandClick(state) { var TargetBaseControl = document.getElementById("commentsTable"); var Inputs = TargetBaseControl.getElementsByTagName('input')...

drop down options depending on the selected radio button in javascript

i have two radio buttons: in-campus and off-campus. when in-campus is selected the dropdown will have some options and when off-campus is selected there will be a different set of options. how can i do this in javascript? ...

is it possible to get anchor visited state from javascript?

i'm using jquery. i have a anchor list. i'm enumerate anchors, if it visited, set display:none; i need when click on the anchor, anchor will changed to visited state from javascript? How can i do? ...

java script, XMLHttpRequest, permission denied within browser

my js file calls uses an xmlHttpRequest to display an rss feed. when i reference the java script within my html page, my browser renders an error: Permission denied. and therefore, my script is being blocked. i am not allowed to change the security settings and would i'd appreciate any work around tips. thanks! ...

How to open print-preview page upon clicking on hyperlink ?

Every browser has print preview command in their File menu I want to make "print" button on HTML page and upon clicking i want to open print preview page. is this possible? With this we can open print options <a href="javascript:window.print()">Print this page</a> but can we open print-preview page instead print options ? ...

Send variables to javascript(jquery) function.

Hi, I wont to be able to send a variable to a JavaScript function when I click on a link but for some reason I cant find anywhere on how to do it on the internet. Here is the function at the top of my page: <script> $(document).ready(function(){ $('[name=updateInterface]').click(function() { $("#interfaceScreen").load("modules/interfac...

Properly Sizing of Google Map in a DIV in percentage

Hi all, I am facing an interesting problem while working on Google Map Page. Actually I want the Map DIV will cover the 70% of Width leaving 30% for My Menus and 60% of Height leaving 40% for my website banner. When I assigned the div height and width in % the map will not render properly instead it either shrinks to top or left depend...

PrototypeJS observe windows dimensions change ?

Hi, I'm trying to create my own 'modal' window since none of these currently existing for PrototypeJS fits my needs. The problem is observing document.documentElement for change of height and width of viewport ( or document.body, depending on Quirks/Standard mode ). ...

How to show/hide the same blocks inside similar blocks with JQuery

Code as follows: <div class="mama"> <div class="son">Item 1</div> </div> <div class="mama"> <div class="son">Item 2</div> </div> $(".mama").hover( function() { $(".son").show(); }, function() { $(".son").hide(); } ); Forward to help. Thanks! ...

Excel and Javascript for APIs

I want to use JavaScript to access the Google Maps API from Excel. What is the best way to do this? (Users will enter input data into Excel, and my JavaScript will query Google Maps for the corresponding values.) I am not concerned about the JavaScript itself, just how to get the script's output into Excel. What if I hosted the JS on ...

Help converting this piece of code from jQuery to plain javascript

Hi... Trying to add dynamic borders on my website top, left, and right sides... The pages on my site are dynamic... That is they change... I need to have a script that adapts a div to the webpage simply... Anyone know this? I got this script from some guy on this forum, but I am trying to avoid jQuery (don't ask)... <p class="bgr">Con...

Best SEO method to translate a website page with google translate

So must of us have a lot of content on our sites in one language or another. Since we are web professionals we spent all that time we could have been learning human languages - instead learning computer languages. So we need someway to translate our content. Google provides a translation service (among others) and so given their massive...

ASP.NET, JQuery - Sharing regular expressions

If you have a fair number of regular expressions used by both client (javascript) and server side code (C#, vb.net) and want to store them in one place to avoid duplication, where do you store them? I could use registerscript and write out the regex as strings, but just wondering if there is something more elegant. ...

Jquery help me analyze what happened: mouseover/mouseout ok but not hover/unhover

I've been working on some code where I trigger the code on hover/unhover. Then I decided to trigger the same code also on focus/blur. Usually with hover/unhover only, I go for the usual hover comma no unhover format. But this time since I was trying to add focus/blur, I had to use bind and use this.bind with the second part too, like thi...

decreasing font size in a text box dynamically

Is it possible to dynamically control the font size in a text area / text box so it decreases while the user types? (ie the character i+1 is smaller than character i) Thanks ...

How can I change the location of a page and not redirect the user?

I want to be able to change the address of a page but not issue any HTTP requests upon making that change. How can this be done using JavaScript? ...

Using a dynamic <script> (a <script> appended to the DOM by JavaScript) to load and initialize Clicky Web Analytics

I'm creating an HTML/JavaScript widget to be used on third-party sites. This widget is generated by a <script> that our customers will insert on their page. The <script> creates an <iframe> in the customer's domain, and then creates and inserts all of that <iframe>'s content using JavaScript. It's important that this <iframe> contain Cl...

Prioritize JavaScript Scripts: Defer Not Working

I need to prioritize scripts so jQuery, Cufon, and my .js files come before Twitter does. I've tried defer="defer" as well as placing scripts in the bottom in the order I want them to execute but all these methods aren't working. I don't want to modify Twitter's files either. Anything I can do? ...

Google Maps API: Trouble with GDirections object literals

I am successfully calling GDirections to get a map with directions between a point A and point B that I have specified. However, I can't seem to get certain return values. calculateDistanceFromRoute.js: var map = new GMap2(document.getElementById("map_canvas")); function initialize() { if (GBrowserIsCompatible()) { var m...

Jquery .live works but not with .datepicker

Thanks for looking, all sincerely helpful answers are up-voted. I have some date input fields that are there when the page loads and a bunch that get generated dynamically. Instead of calling .datepicker() on that class each time a new instance is generated, I'm using .live, but it doesn't seem to be working. Any idea why? $("input[name...