javascript

jQuery-JSONP plugin fails when placed in a directory

I have an HTML page that uses the JSONP Plugin to gracefully handle errors in my JSONP call. My problem is quite perplexing (and I hope it has a simple, easy "D'Oh!" solution :)). When the .js file is in the same directory as the HTML page and is loaded like this: <script type="text/javascript" src="jquery.jsonp.min.js"></script> All ...

is there some special setting for servers to run jQuery ?

i had an html page that run some jQuery scripts and that works ok. but once i use the same scripts in php page then tries to run it using local server (xampp) it doesnt working .. then i tried to upload files on linux server over the internet but neither the html nor the php pages worked right ! so did i miss something ? is there some ...

Drag and Drop Table Rows Using Javascript

I'm wondering if there is a good library or script out there that trivializes drag and drop functionality for table rows in Javascript? Really the only requirement I have is that rows must be draggable within the table itself, but also to other tables on the page. I'm not too familiar with JQuery or Javascript itself, so I'd like to try ...

what happens when cookies file exceeds maximum size?

What really happens when cookies file exceeds maximum size? ...

Javascript RegExp always failing

When I test my javascript at this site it behaves as I would expect. However when I try and test it on my page it ALWAYS fails the test function testName() { if (new RegExp('^(?!^(\..+)?$)[^\x00-\x1f\\?*:^&!`~@#$$+=<>\?\*;|/]+$').test("me")) { alert("good"); } else { alert("invalid characters"); } return...

Graphs from MYSQL to jquery FLOT

Hi friends, I've discovered flot for jquery for drawing nice graphs. But I can't parse the data I want to represent from MYSQL. It's driving me crazy because I get this error: uncaught exception: Invalid dimensions for plot, width = 0, height = 0 Is there any way to put MYSQL data into flot apart from this?: php part: <?php includ...

Including Javascript with a custom control in an ASP.Net website

I have a custom date control which is essentially a text box and the ajaxToolKit calendarExtender. I want to include Javascript in the control and have it work properly no matter what page the control is on. The control is called DateControl.ascx So I have two Javascript functions, dateEditor_OnShown and dateEditor_OnHiding. They get...

Referencing items within a gridview

I have a a gridview attached to an objectdatasource. In each row I have a bound textbox for input. I have a button beside the textbox in each row that launches a javascript popup for unit conversion. The question is: how can i tell the unit converter (js function) what textbox (in which row) to populate the results with? ...

depth of a child in the DOM

Can I have any way to know which is the depth of a child based on a container. Example: <div id="dontainer"> <ul> <li>1</li> <li>2</li> <li id="xelement">3</li> <li>4</li> <li>5</li> </ul> </div> You should get 2 for "xelement" (taking as starting at 0). Knowing that the "li" are at the same level...

Multiple buttns on a page - not working

Can someone tell me why the following is not working? <head> <script language="javascript" src="/assets/js/jquery-1.3.2.js"></script> <script type="text/javascript"> $("button").bind("click", function() { alert("You clicked " + $(this).attr("id")); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <...

How to unset a Javascript variable?

I have a global variable in Javascript (actually a window property, but I don't think it matters) which was already populated by a previous script but I don't want another script that will run later to see its value or that it was even defined. I've put some_var = undefined and it works for the purpose of testing typeof some_var == "und...

jQuery works in Firefox when Firebug is running, does not work when Firebug is NOT running

I have the following Javascript libraries loaded for my page. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; <script type="text/javascript" src="http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js"&gt;&lt;/script&gt; <script type="text/javascript" src="./js/jquery...

Quick and easy way to open a URL as a subwindow on mouseover in javascript?

I am trying to accomplish something very simple, and I'm hoping someone can point me in the right direction in the form of a javascript library that will do most of the work for me. When the user mouseovers certain links on a page, I want the content of the target URL of the link to load as a "tooltip" style subwindow at the mouse curso...

how to pass information from php to javascript

I'm working on a web UI control called Folder - it basically mimics Windows Explorer folder - you see a grid of items inside a rectangle and can drag an item around, drop an item inside a different instance of the control, add new items and so on. each item is made of an item template - basically some php code that dictates the look of t...

Security concerns with uploadify

I just implemented uploadify in my project, and I noticed what seems like an important security issue with the uploading process: The folder in which the file should be uploaded is provided as a javascript argument, so client-side. If the user changes the script, and fills in a different folder (i.e. "/") for the upload, the file gets u...

Why am I seeing inexact floating-point results in ECMAScript / ActionScript 3?

Hey all, let's jump straight to a code sample to show how ECMAScript/JavaScript/AS3 can't do simple math right (AS3 uses a 'IEEE-754 double-precision floating-point number' for the Number class which is supposedly identical to that used in JavaScript)... trace(1.1); //'1.1': Ok, fine, looks good. trace(1.1*100); //'110.00000...

How is server-side javascript used/implemented?

I'm aware of server-side javascript for a long time now, but I don't have a clue about how it works. Could someone point me in the right direction? I'm interested in how to use server-side javascript + Java Servlet technology EDIT Great! I have seen those technologies before, but for some reason I didn't associate them with "server-...

Excel and IE7 - Prevent IE from opening Excel files

I have a intranet webpage that is used to hyperlink to various files on a file server. The problem with the local-file linking is that Microsoft Excel files are opened in IE7 instead of Excel. This results in the Excel files VBA code and other features from working correctly. Is there a way using HTML/Javascript to force the file to be ...

Is it possible to automate taking a screenshot of a portion of a Web page (e.g., denoted by a CSS selector or HTML parent element)?

I'm not sure if the title conveys the best approach to my problem, so let me step back a little bit. My company is setting up an advertisement affiliate program. We have a widget that will soon be displayed on numerous Web pages, and this widget will contain an advertisement block that will show various ads from our affiliate retailers....

ASP.Net Ajax PageMethod - retain reference to DOM object

When calling an ASP.Net PageMethod, we call it as follows: function doSomething(htmlElement) { PageMethods.GetText(onSuccess, onFailure); } What is the best way to retain a reference to the htmlElement in the above example, so that we may continue to work with it in the onsuccess method? Thanks for any help in advance ...