javascript

PHP json_encode as object after PHP array unset()

I'm experiencing odd behavior with json_encode after removing a numeric array key with unset. The following code should make the problem clear. I've run it from both the CLI and as an Apache mod: PHP version info: C:\Users\usr\Desktop>php -v PHP 5.3.1 (cli) (built: Nov 20 2009 17:26:32) Copyright (c) 1997-2009 The PHP Group Zend Engine...

javascript function overloading

Can I do the following? function contains(element) { // if the element is a Vertex object, do this if (element instanceof Vertex) { var vertex = element; for ( var index in self.verticies) { if (self.verticies[index].id == vertex.id) { return true; } } return false; } // else if the element is an Edge object, do ...

Oauth server redirect on success or error, use HTTP redirect or Javascript?

All Oauth providers I've authenticated with will redirect you to a page that says something like "Thanks, redirecting you..." and uses javascript to redirect you to the supplied redirect_uri. I would have thought it was simpler and faster to return an HTTP redirect. Why is it always done that way? ...

how to ajax post an image to a C# web method with jquery

Possible Duplicate: How can I upload files asynchronously with JQuery? I have a file upload field, after the image was selected, i make a jquery ajax post to an aspx page's page method. My question is, how can I pass that image via jquery? When I do $(this).val() it only gets the file name. I want to pass the image object itse...

Why call window.open twice without waiting for window.close to finish?

Seeing on various sites some web JavaScript for displaying a window (say once a button is pressed) and I don't understand why you would call window.open twice, the first is normally to blank or some static error page, the second is to the actual content somewhat more heavy weight like a pdf. Is this normal, should it work? currentDialo...

include path and ajax not working?

I couldn't get "castMyVote" function to execute. It worked when I cast a vote in poll.php but not in index.php. I have ensure all php and js are in correct path. I tried another function "displayvotewithoutvote" in Index.php, I could display statistic without vote. index.php: include('poll.php'); poll.php: <a href="#mainContainer" o...

jQuery - Click on X, grab the NAME, then use that to show a related element

Here's what's happening. My page loads. Then jQuery loads a feed which is injected into a contentCol div... in that feed is: <a href="" name="storyItemComments_66" class="commentWrite">Comment</a> There is also: <div class="storyItemComments" id="storyItemComments_66" style="display:none;">.... For some reason this is not working...

How to get the selected radio button value using js

I am currently using this code but it does return the selected radio button value var mailcopy = document.getElementById('mailCopy').value; Please tell any other possible way to get currently selected radio button value using Javascript ...

How to determine how many scripts are awaiting execution in firefox ?

How can I determine the number of scripts awaiting execution within firefox? (The execution queue) And would this include code scheduled with setTimeout ? ...

How to implement a window, or div, that can stay on top of any Chrome browser page, when invoked?

I want to implement an extension in Chrome that I'd display some text related to the current page being viewed. I have learned ways to code div to be part of an HTML page that is specifically designed to support such always on top popup (div), but I have no clue how to make a window/div or whatever text area to stay on top of any web p...

how can i show specific data based on currently selected option in a dropdown list?

little background: currently putting together a website that is selling products, many of which come in various sizes, with respectively different prices. I have the database set up to handle all of this, and I know well enough how to write the PHP code to query said database to get any product in a specific size (with all it's related...

How to fix mouse moving (Drag & Drop)

How to fix mouse moving, to a pointer was always located on the middle of an element and worked synchronously? Please see my full example like this example ...

On mouse over show information.

I have a list of items like here in stackoverflow list of question. For every item's owner name is a link clicking on which it navigates to the the profile page(like in stackoverflow also). But my current requirement is that on mouse over the link I have to show a popup(like in facebook) with some information of that person. So how do th...

How do I make a link to the previous web page in my Perl CGI program?

I have a grid which has a link to next page and I have a button to navigate back to the grid from the current page. Until now I was using this method to navigate back i.e <INPUT TYPE="BUTTON" VALUE="Back to Datagrid" onClick="history.go(-1);"> But I faced some issues navigating when I had some other constraints along with that, s...

problem with callback function in javascript

Hi, I am trying to understand callback functions in javascript. There is a function something like function load() { var func = function(data){ /// }; } Can anyone explain me from where the parameter "data" will be returned, as I dont see any variable declared in the file. ...

Multiple updatepanels on page remove JavaScript Datepicker calender from textbox

Actually I have Multiple update panels on page, which update different values on server but the problem is that I have textbox to which I attach javascript class for datepicker on Load event. But There are other updatepanels before that date TextBox, when I update them first calender image with date control which is in updatepanel disa...

javascript parser for a string which contains .ini data

Hi, If a string contains a .ini file data , How can I parse it in JavaScript ? Is there any JavaScript parser which will help in this regard? here , typically string contains the content after reading a configuration file. (reading cannot be done through javascript , but somehow I gather .ini info in a string.) ...

boundary-points of a range does not meet specific requirements

I am writing a script on which the user needs to be able to select some text which is sent via ajax to the backend script for further process. I can select plain text nodes fine or text nodes that have bold, italic or underlined text inside it. For e.g <p>This is <strong>some</strong> cool <em>italic</em> text, <u>really!</u></p> So...

How can I update window.location.hash without jumping the document?

I have a sliding panel set up on my website. When it finished animating, I set the hash like so function() { window.location.hash = id; } (this is a callback, and the id is assigned earlier). This works good, to allow the user to bookmark the panel, and also for the non JavaScript version to work. However, when I update the hash...

iPhone safari web app floating div

Hello, Am wondering how to achieve a floating div in iPhone Safari. position:fixed does not work unfortunately. Thank you for your time. ...