I am calling a service that return json data.
script:
$.ajax({
type: "POST",
url: "/some/service",
dataType: "json",
success: function(response) {
if (response.status == "ok" && response.messages.length > 0) {
// obj is a jQuery object
obj.trigger(SOME_EVENT, response.messages);
...
If I've for example an object like:
{start: 1, end: 2, someString="someStringValue"}
Is there any simple way to serialize it into a string of data? Example:
start=1&end=2&someString=someStringValue
Thanks.
...
Hi. :-)
I've used an object tag to load my Silverlight control because I want to be able to input html into a Sharepoint page using the Rich Text Editor. It looks like this:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="SilverlightObject"
width="850" height="600">
<param name="source" ...
I have 3 functions, with the third function under the first that I want to run in the second.
function first () {
function third () {
}
}
function second () {
third ();
}
How can I make second run third correctly?
Thanks.
...
Thanks for the responses.. i put a live version of the code.. to see if that helps resolve this. It is here:
http://www.zacharydesigns.com/sandbox/calculatorJS.html
I updated the following code to reflect what was offered as an answer.. however this just returns zero
I am having trouble wrapping my head around creating a simple equat...
Hello all
I"m trying to do something that I originally thought would be quite simple, but it's turning out not to be. Mainly I'm trying to have so I can have a textarea on a page, with a button that would allow the user to copy everything within the textarea to paste wherever they wish. However after slogging through a few attempts and ...
I have a feeling that I'm missing something simple here but can't seem to find it.
I'm using SwfUpload and on its uploadSuccess() event, I'm showing a "success" message on the screen while hiding the progress image. Below is the snippet:
swfu.uploadSuccess = function(file, serverData, response) {
document.getElementById("progressI...
Suppose I am using an MVC framework, and my views require Javascript files located in a file external to the view. My javascript located in the external file depends, however, upon a few PHP variables in my view. If I were to include the Javascript in a tag inside my HTML view, I could simply inject the PHP variables into the Javascript...
I'm revisiting an ID scanner station program we built ages ago and I have a request from users to make a system beep. We're considering moving the system to a web browser, but is it possible to invoke a speaker beep via javascript or something? It doesn't need to be cross-browser compatible, but it probably needs to work on Windows or Li...
Hi.. I almost have this working however the script is rounding my numbers while I wish to keep both decimals places for a full price instead of being automatically rounded up. My sandbox for this script is here:
http://www.zacharydesigns.com/sandbox/calculatorJS2.html
and here is the code:
<script type="text/javascript">
functi...
I have a blob of HTML that I'm retrieving using simple jQuery selectors, something like the following:
<div id="stuff">
<ul>
<li>some</li>
<li class="ninja">stuff</li>
</ul>
</div>
I'm basically doing:
var myblock = $("#stuff").html();
now I want to inject an additional li element to the bottom of that li list with very si...
In IE, if flash has focus, and receives a keydown event, it does not appear to bubble the event up through the DOM (I can't capture the event by listening on document, however the same listener can capture key events from html siblings, so I know my listener is working).
However, some other plugins on the page (I am looking at you windo...
I'd like to pull in the jquery library from my javscript include.
Does this work 100% of the time? Is there a better way?
(function() {
var loadJquery = function (cb) {
var addLibs = function () {
if (typeof(document.body) == "undefined" || document.body === null) {
setTimeout(addLibs, 100);
return;...
Hello!
I've been looking for a really easy/lightweight way to just be able to click thumbnails to switch the src of a larger image.
This is what I've found:
http://snipplr.com/view/8688/jquery-image-swap/
I haven't actually tried it out yet. Is this the best solution?
The larger images to be swapped in will have the same width but ...
This is an odd question. I have a friend who is working on an application. There is a table with 4 fields that holds a word and a definition among some other things. On a website there is a textbox in which a user can enter a string and the database is queried and looks for similar content while the string is being entered in the box. (A...
So I'm working on a firefox extension that we'll be using internal (thus not terrible worried about security), and I'd like to be able to interact with the functions and values defined in the javascript of a webpage. I'm having trouble reliably finding variable definitions.
Take for example gmail, it has a VIEW_DATA list that has email...
I have an Android application that generates some HTML which is rendered locally, in a Webkit view.
The details of the HTML generation aren't really that important except for:
the bulk of it comes from one place, and I cannot change it
the template around that HTML (including headers, footers, HEAD etc), the CSS, and Javascript is un...
I have a java Script function that i want to call whenever mouse moves so whats the way to call it in java script.
Thanks
...
Hello evryone.
Here's my issue.
I have a javascript function that update a div when i click the proper link. And it is working.
Since i have cliked the link my div content is updated with another Javascript. This time to close it.
Its fairly simple but i cant get it to work and i dont know why!
Here is the code that is in the page ...
Can someone describe and a high level (with detail ofcourse) how one goes about designing a html editor preview feature?
(like on this site)
What do you have to do really?
...