javascript

JavaScript event window.onload not triggered

Hi! I've got the following code in a website: window.onload = resize; window.onresize = resize; function resize(){ heightWithoutHeader = (window.innerHeight - 85) + "px"; document.getElementById("haupttabelle").style.height = heightWithoutHeader; document.getElementById("navBar").style.height = heightWithoutHeader; } The ...

What is the best for make charts on iPhone view WebPage?

Hi all, I have to make some charts on a "mobile" website, what is the best framework to do this? I see Google Charts API, JQuery Visualize, Raphael and JS Charts... but i don't know who is the best one in Safari Mobile. Thanks in advance to your response. ...

Expanding videoplayer like CNN-website, prerably jQuery-based

I'm wondering if anyone knows of a script/plugin, jquery-based or otherwise, which could be used to achive the effect that can be found on CNN.com. I'm talking about the videos that are representet by a small thumbnail, that when clicked expands in to the text and plays. I'm by no means a JS-guru, and me and flash isn't the bestest of ...

Center Google Map on point from database?

I'm trying to center a google map on a single marker pulled from a database, what I'm doing so far is using this function to get a single marker from the database function getMarkers(){ var urlstr="readsingle.php?v=<?php echo $cam ?>"; var request = GXmlHttp.create(); request.open('GET', urlstr , true); // reques...

Accessing parameter of one function from another in javascript

var vehiclePage = (function(){ // defined these 3 public variable. to share between zoomNoShowFee & submitVehicle this.obj; this.rate; this.idx; var setPara = function(o,t,i){ this.obj = o; this.rate = t; this.idx = i; } return { zoomNoShowFee : function(o,t,i){ // t...

Does String inherit from Object in Javascript?

Is Object the base class of all objects in Javascript, just like other language such as Java & C#? I tried below code in Firefox with Firebug installed. var t = new Object(); var s1 = new String('str'); var s2 = 'str'; console.log(typeof t); console.log(typeof s1); console.log(typeof s2); The console output is object object string ...

I need some pointers on how to implement inertia

Ok, so I've created a little plugin that takes a bunch of elements and creates a sort of never ending list. I'll try to explain... I have a div, and it's got about 20 elements tags in it. When the user scrolls up, the top element moves out of view and is moved to the bottom of the list. And vice-versa so that when the user scrolls down,...

Javascript points calculating system

I trying to create a points calculating system with javascript, but the problem is with the mathematical part. I have saved on the server the points number, and based on that number I want to decide the level. Sorry for my bad english, I cant explain very well :D. I want something like: level 1 need 0 points level 2 needs 100 points leve...

Included php file calling Javascript function

Hi there! Here's the deal. I've got index.php which links to an internal JS file in it's header. index.php then includes another .php file, which outputs this: + add file. addFile() is a Javascript function defined in the external JS file. By doing this nothing happens, the included php does not "see" the JS function. Encapsulating the...

focus after animate

i'm tring to focus a textarea after a animate effect with: $("#textarea").live("click",function(){ if ($(this).attr("class") != "textarea_clicked") { $(this).val(""); $(this).animate({ height: "+=30" }, 150, function(){ $(this).attr("class", "textare...

Function pointers in javascript using django

Is this a valid function pointer code below, In views , def change(request): dict={} function_ptr="create()" dict.update({'function_ptr' : function_ptr}) return render_to_response('mpjt/create.html',context_instance=RequestContext(request,{'dict': dict})) In create.html $(document).ready(func...

ExtJS Close button on each tab in a Tabpanel

The Extjs API site adds a new tab for each search you do. The tabs each have a red X on them to close the tab similar to what browsers have. Check it out here: I'd like to replicate this and it seems like something that would be built-in to the API, but cannot find it. Any ideas? ...

Removing the "d" object from ASP.Net web service json output

I have some javascript code that processes json output from asp.net web services built with framework 2.0. Now I need to support data returned from framework 3.5 web services. My javascript code assumes a list of objects as return value, which works fine in 2.0. However In framework 3.5, the list is wrapped in a "d" object. Is there an...

Can a Jquery Ajax Call Accept an Object on Succes from PHP?

I'm writing a simple ajax function and looking to populate two text input fields with the 'success' results. I'm wondering what my php syntax has to be to return an object. Here is my Javascript function function editModule(a){ data = {moduleNum:a} $.ajax({ type: 'POST', data: data, url: 'includes/ajaxC...

Dropping the '.00' when printing floats that hold whole numbers

I'm currently displaying a quantity in Javascript. I want it to display (for example) the whole number as 89 instead of 89.00; however, if the number is fractional like 89.50 then it should display 89.50 ...

jquery: how can i load the Google Maps API via ajax?

Before you reply: this is not as straight foward as you'd expect! I have a 'show on map' button which when clicked opens a dialogbox/lightbox with the google map in. I don't want to load the maps api on pageload, just when a map has been requested This is php file the "show on map" button puts into the dialog box: <div id="map_canva...

how to fire mouseover event programmatically java script

How to fire mose hover event. Things is I have table which has few rows which i render dynamically. for few cells(columns ) I have tooltips created dynamically. now for each refresh call i destroy all rows,tooltips and other even handlers and create it from scratch. Now the case is My old mouse hover tooltip is destroyed and new one is...

Craziest JavaScript behavior I've ever seen

And that's saying something. This is based on the Google Maps sample for Directions in the Maps API v3. <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Google Directions</title> <script type="text/javascript" src="http://...

Give idea to display the datetime in my aspx page.like digital clock

Each and every second the datetime will be updated like a digital clock. formate like:YYYY:MM::DD:HH:MM:DD:A.M ...

How do I copy a JavaScript object into another object?

Say I want to start with a blank JavaScript object: me = {}; And then I have an array: me_arr = new Array(); me_arr['name'] = "Josh K"; me_arr['firstname'] = "Josh"; Now I want to throw that array into the object so I can use me.name to return Josh K. I tried: for(var i in me_arr) { me.i = me_arr[i]; } But this didn't have ...