I've created a custom object that I'd like to return in JSON to a javascript method. This object was created as a class in C#.
What's the best way to return this object from a PageMethod ([WebMethod] if you like) to a javascript onPageMethodCallback() function? I need to be able to access the properties of this object via javascript...
Dear All
I am using Json in php, Now I need to access it from javascript,
How to pass json object ,to javascript?
<?php
$array = array("a"=>"Caucho", "b"=>"Resin", "c"=>"Quercus");
$json = json_encode($array);
>
Where My.js has
showAll(){
alert("Show All Json Objects");
...
I'm trying to use sIFR (with the jQuery sIFR plugin) on my website, but have run into problems right from the start. I was able to create the swf with my chosen font, but when I run the script, I just get the default "Rendered with sIFR3" message instead of the text of my element.
Any ideas?
As Novemberborn himself pointed out, I did...
I have strings like X,Y. I want to separate X from Y using javascript. Please describe how to as I am new at javascript
...
While trying to integrate Yahoo Media Player into my own website, I want to allow users to click on a link to add the clicked track to the playlist. YMP API has got a function for doing that (http://mediaplayer.yahoo.com/api/#method_addTracks). It takes a DOM element. Now how should I pass the dom element. My code looks like this right n...
I want to run the following code:
ajaxUpdate(10);
With a delay of 1 second between each iteration. How can I do this?
...
Does anybody know of a method to trigger an event in Prototype, as you can with jQuery's trigger function?
I have bound an event listener using the observe method, but I would also like to be able to fire the event programatically.
Thanks in advance
...
Is the window object onclose() or closing() event exposed in HTML/Javascript?
...
I could use a goog set of eyes on my project. I am designing a skin for the google maps API that resembles the native Google Maps App on the iPhone. Ive already got it:
1) Displaying a custom info window
2) Custom pins/markers
3) Pins falling from the sky on load
4) Pulling data from an XML file
Unfortunately I can not get it work...
I'm adapting a pretty basic js function into a class. Anyway, basically it just creates a floating container
above the main page. I'm aware it's incomplete, but I'm in the middle of typing it up, and keep getting caught out when attempting to call the close() function. Firefox returns a this.sdiv is undefined. I'm confused as to how thi...
I'm trying to use the javascript port of processing found at http://ejohn.org/blog/processingjs/ I want to use the following constructor. Processing(CanvasElement, "some massive block of code"); I know javascript doesn't natively support multiline strings but is there a way to pass something like the following with out having to concaten...
I am currently logging an AJAX application with messages which include the times of certain interactions. So I have a couple of places where the code follows a pattern such as this:
var startTime = new Date();
this.doFunction();
var endTime = new Date();
logger.log("doFunction took " + (endTime - startTime) + " milliseconds.");
What...
What's the best way to pass an optional argument that is nearly always the same? Case in point is Javascript's parseInt function; the second argument for radix is optional, but to avoid a string beginning with a zero being treated as octal, it is generally recognized good practice to always specify 10 as the second argument. Fair enou...
I get Error: 'CanvasElement' is undefined when trying to run the following code using the javascript port of processing.
var p = Processing(CanvasElement);
p.size(100, 100);
p.background(0);
p.fill(255);
p.ellipse(50, 50, 50, 50);
Any help with this would be appreciated.
...
I know of two methods of setting a default parameter, but I would like to know what the preferred method is.
function Foo(par1, par2)
{
if(par2 == null)
par2 = "my default"
}
or
function Foo(par1, par2)
{
par2 = par2 || "my default"
}
or is there a better way than either of these?
EDIT:
I would also like to know h...
I've an old website, navigation in an frame at left, pages at right.
I want when an page is url'd directly the nav (left frame) shows also.
Until now I was an js working, but I don't know from when it are not working,
now returns this message:
*Forbidden
You don't have permission to access /master.html on this server.
Additionally, a ...
I don't wanna come across as a troll, so please excuse my question's demeanor, but I am a novice-intermediate programmer taking a stab at AJAX. While reading up on JavaScript I found it curious that most of the examples I've been drawing on use PHP for such an operation. I know many of you may argue that 'I'm doing it wrong' or 'JavaScri...
I have a div where I click on a link to slideDown. As expected it does what it promises however, I prefer it to slide open without pushing the other elements down as well. so like a layer on top of other layers. is this possible ?
...
I have one two divs and two seperate links that triggers slideDown and slideUp for the divs.
When one of the divs are slided down and I click the other one, I hide the first div (slidingUp) and then open the other div (slidingDown) but, at the moment its like while one div is sliding down, the other, also in the same time, is sliding up...
In JavaScript, there are two values which basically say 'I don't exist' - undefined and null.
A property to which a programmer has not assigned anything will be undefined, but in order for a property to become null, null must be explicitly assigned to it.
I once thought that there was a need for null because undefined is a primitive va...