javascript

Override members on a built-in JavaScript object

I would like to override the default behavior of the offsetParent member of all html elements. I would like to do something like this if it's possible: // For <div id="foo"></div> var oFooElem = document.getElementById("foo"); oFooElem._offsetParent = oFooElem.offsetParent; oFooElem.prototype.offsetParent = function() { window.statu...

Passing parameters to a JQuery function.

Hello, ive a problem using JQuery.. Im creating a HTML with a loop and it has a column for Action, that column is a HyperLink that when the user click the link call a JavaScript function and pass the parameters... example: <a href="#" OnClick="DoAction(1,'Jose');" > Click </a> <a href="#" OnClick="DoAction(2,'Juan');" > Click </a> <a ...

Scrollable div without overflow:auto ?? (javascript)

In my app I have 2 divs, one with a long list of products that can be dragged into another div (shopping cart). The product div has the overflow but it breaks prototype draggable elements. The prototype hacks are very obtrusive and not compatible with all browsers. So I am taking a different approach, is it possible to have a scrollable...

SproutCore and Cappuccino

I'm about to build a web app and I would like to use either SproutCore or Cappuccino. Only thing is, I can't figure out which one to use... I've been reading about them, and they seem to share the same goals (MVC on the client, with a thin REST server). I understand that they differ in their implementation (Obj-C vs JS), but I'm having ...

How can I efficiently manage Perl modules for code reuse?

hi there, My company develop web apps using combination of mod_perl, axkit and apache. We have tons of Perl modules, javascripts, etc, all in unix operating system. Whenever I need to write a new function, I try to do some code reuse, but the thing is all the Perl modules and javascripts are scattered across folders. i hate to write s...

how to access a database using javascript

I have to display marks of my students through my site. the database is created using msaccess. how can I display the marks of each student in a table, as the enter the regno. ...

How to get DataTextField of DropDownList in javascript?

Hi, I am using a DropDownList as <asp:DropDownList ID="ddlLocationName" runat="server" DataValueField="Guid" DataTextField="LocationName" AppendDataBoundItems="false" AutoPostBack="false" onchange="LocationChange()" ></asp:DropDownList> and when I select item from dropdown the DataTextField should be displayed i...

javascript problem - including php

Hello, I have the code pasted below, which servers as the core of a small ajax application. This was working fine previously, with makewindows actually displaying a popup containing the rsult of artcile_desc. I seem to have an error before that function however, as now only the actual php code is outputted. This is not a problem with my...

jquery UI Dialog and __DoPostback

Hi All I have a problem with the jquery-ui dialog in ASP.NET form, $("#pnlReceiverDialog").dialog({ autoOpen:false, modal: true, height:220, width:500, resizable :false, overlay: { opacity: 0.5,background: "black" }, buttons: { "Cancel": function() { $(this).dialog("close"); }, "Ok": function() { ...

loadVideoById() in YouTube's regular player (not chromeless)

I have a YouTube's player in the webpage. I need to change the video played by this player dynamicaly. This is (relatively) easy using YouTube's chromeless player. It has method loadVideoById() which works perfectly. The problem is, that the chromeless player doesn't have any controls (play/pause, etc.). The regular YouTube player has a...

HTML + Javascript: Dynamic Image Resize?

Hello, I am trying to get some javascript to programatically adjust a html img tag's width to display various sized images correctly. I have a fixed width img tag at 800px to display an image, this is the max width. If the image is wider then 800px I want to display it at 800px wide; If the image is less than 800px wide I want to pres...

HTTP file download with Javascript

Is there any way (in Javascript) to download a remote website (i.e. like with Curl), read it into a string variable and further process it? ...

ajax php variables in javascript

Hello, I have the below code, which was previously working fine: var xmlHttp var layername var url function update(layer, url) { var xmlHttp=GetXmlHttpObject(); //you have this defined elsewhere if(xmlHttp==null) { alert("Your browser is not supported?"); } xmlHttp.onreadystatechange = function() { if(...

local file access with javascript

is there any local file manipulation that's been done with javascript? i'm looking for a solution that can be accomplished with no install footprint like requiring AIR. specifically, i'd like to read the contents from a file and write those contents to another file. at this point i'm not worried about gaining permissions, just assuming...

Do you ever need to specify javascript: in an onclick?

AFAIK, you never need to specify the protocol in an onclick: onclick="javascript:myFunction()" = bad onclick="myFunction()" = good Today I noticed in this article on Google Anallytics that they are using it: <a href="http://www.example.com" onClick="javascript: pageTracker._trackPageview('/outgoing/example.com');"> Is this example ...

Why in JavaScript is a function considered both a constructor and an object?

I have been doing a lot of research on this lately, but have yet to get a really good solid answer. I read somewhere that a new Function() object is created when the JavaScript engine comes across a function statement, which would lead me to believe it could be a child of an object (thus becoming one). So I emailed Douglas Crockford, and...

jQuery autocomplete - How to handle extra data?

I'm struggling with the following problem. I use the jQuery autocomplete plugin to get a list of suggested values from the server. The list would look like this: Username1|UserId1 Username2|UserId2 So if I start typing "U", a list of "Username1" and "Username2" pops up, as expected. I could chose the first item and the <input>'s valu...

Drawing a caret between a point and a draggable div

Hi all, I have a draggable div that represents a little info popup that the user can drag around the screen. But this div is anchored to a point on the screen, and I would like there to be a caret drawn between the div and the point that it is anchored to. An example of this can be found on Google maps, when you hover over a store or ...

Maintain scroll position in Javascript window.open()

How do I maintain the scroll position of the parent page when I open new window using window.open()? The parent page returns to the top of the page. Here is my current code: <a href="#" onclick="javascript: window.open('myPage.aspx');"> Open New Window </a> ...

Counting down for x to 0 in Javascript?

I have from the backend a time on the format 00:12:54 and I display it to the screen. But, I would like to have this time to continue to go down. I have though to create a variable in javascript that will old the time and with setTimeout to loop to display with document.getElementById the new value. I think it can be problematic if I hav...