javascript

change width of a div dynamically

I am trying to change my "inner" div's width dynamically on the click that the images are changed (which works) with a similar script. I cannot get the script to work, any help fixing it, or changing it would be appreciated. I am a noob in javascript so please be nice ;-) <script type="text/javascript"> function setBase(baseval) { ...

What's wrong with this Javascript code?

<a href="javascript:document.getElementById('create_table').style.display='block'">Insert Table</a> The code works perfectly fine in Google Chrome but in Internet Explorer and Firefox it just redirects to a page with the text "block" ...

Can php detect if javascript is on or not?

I have page which created dynamically. Now I want to add ajax function, so I want to add if statement to change the outputs. if(js is on){ ... ... echo "js is on"; }else{ ... echo "js is off"; } Is there any way I can detect if js is on with php? Or is there any way I can remove/hide it by jquery? Thanks in advance. ...

How to calculate Bit Flag in javascript?

im writing a free tool for SEO... implementing an api from seomoz and the flags look like this URL Metric,Bit Flag Title,1 URL,4 Subdomain,8 Root Domain,16 External Links,32 Links,2048 mozRank,16384 mozTrust,131072 these are just a few but i dont know how to calculate the proper bit flag in javascript... is it just an OR of all the in...

direct user to another page

how do i code it as javascript when user leave the field empty, they will direct the user to another page? i'm using asp.net.. ...

how to organize all js, css, php and html code?

Now I know that you can use OOP and MVC to organize, but that is just for PHP. Let's say, I add a new window that pops up when a user clicks on a link and it displays a form with JS validations and it is CSS styled. Here we got 4 codes: JS, CSS, PHP and HTML (with some PHP snippets). How would you organize all these codes? Because whe...

Destination value with DirectionsRenderer in Google Maps v3

Loving Google Maps API V3, but having difficulty in getting accurate driving directions and manipulating the destination address displayed when using DirectionsRenderer. Regardless if I pass an address string or a latLng instance as the destination to DirectionsService, when I use the DirectionsRenderer to output step-by-step directions...

How can I have a hyperlink pass 2 array values to another script and have that script's page printed?

I have a list of names (1-15 rows) I display from an array. I want the administrator to select the correct name from the list by clicking on the hypertext called "link." The record id is in the array and I want that passed to the called script. I found this javascript that works except that I want the linkur.php page to print (with it...

How to modify raphael text?

After instantiating Raphael text like so var t = paper.text(50, 50, "Raphaël\nkicks\nbutt!"); how do I go about then modifying that text? t.text = "test"; //did not work for me =/ ...

javascript parsing

i have this block of code: $(document).ready(function() { //<![CDATA[ var who; FB_RequireFeatures(["Api"], function(){ var who = api.get_session().uid; alert(who); }); alert("the uid is: "+who); //]]> }); the problem: the code outside the FB_RequireFeatures block is executing be...

How to draw an oval in html5 canvas?

There doesnt seem to be a native function to draw an oval-like shape. Also i am not looking for the egg-shape. Is it possible to draw an oval with 2 bezier curves? Somebody expierenced with that? My purpose is to draw some eyes and actually im just using arcs. Thanks in advance. Solution So scale() changes the scaling for all next sh...

automatically detect web browser window width change?

i know that you with $(window).width() can get the size of the web browser. i want to detect when the user change the size of his web browser so i could readjust the columns width. is there a way to automatically detect this or do i have to use setTimeinterval to loop and see if it has changed? ...

Trying to retrieve yahoo weather using jquery / php / xml

Whats wrong with this function? function yahooWeather(){ var loadPage = 'yahooweather.php?p='+ $("#myCity").val(); $("#yahoo").html('<img src="loading.gif" align="absmiddle">'); $("#yahoo").load(loadPage); } Is there another way to write this function. Im unsure if its able to read the .val required, tho i know it is se...

difference between these 2 ways of creating a class in javascript

what are the difference between these two ways of creating a class: var apple = { type: "macintosh", color: "red", getInfo: function () { return this.color + ' ' + this.type + ' apple'; } } function Apple (type) { this.type = type; this.color = "red"; this.getInfo = function() { return this.c...

focus to the beginning of the textarea on iphone?

The function focus() doenst seem to work for iphone? I need something similar to what they have done for gmail.com when you do a reply. ...

jquery.flash plugin not working in IE6

I use jquery.flash() plugin to embed flash into my website. The problem is that in IE6 this doesn't work. I tried swfobject (1.5), also, but it gives me (sometimes) some strange errors with n null or something like that, so I decided to use jquery.flash() also. (I use both swfobject and jquery.flash() now) So, basically, swfobject works...

Filtering XML results using jquery

Using jquery is it possible to filter XML results that are loaded? Ideally i would like to do a mysql style filer/search like SELECT * FROM "example_table" WHERE id="1" I have an XML file loaded in to my application with the following structure <country> <state id="1"> <statename>Baden-Wurttemberg</statename> <cities> ...

How to determine if onbeforeunload has been caused by clicking a link in Chrome

The problem is as follows. Onbeforeunload works like a charm in Firefox and has e.explicitOriginalTarget.activeElement that shows what element has been clicked to cause it. window.onbeforeunload = function(e){ if (e.explicitOriginalTarget.activeElement){ return; } In Chrome the 'e' object looks identical when you close...

How do I write a RGB color value in JavaScript?

I am trying to change the color of the function swapFE() below and I can't figure out how to write it. I was told to change the color of the phrase node to the color value (155, 102, 102). I tried to do that as you can see at the end of the function see- parent.childNodes[1].style.color= (155, 102, 102); but it just comes out a dark navy...

Google Maps InfoBox Not Displaying Correctly in IE

I can only post one link so here is a reference page with corresponding links: http://rireal.com/code/index.html I am using a modified version of extinfowindow for Google Maps v3 (reference link 1) to display a custom infobox window for my markers. While I successfully implemented the InfoBox in v3, I ran into an issue with IE during te...