This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.ajax({ | |
| url: url, | |
| dataType: "json", | |
| success: function (response) { | |
| //do something with the json data | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.ajax({ | |
| url: url + '?callback=someRandomCallback', | |
| dataType: "json" | |
| }); | |
| function someRandomCallback(response) { | |
| //do something with the json data (this function must be global for this example) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.ajax({ | |
| url: url, | |
| dataType: "jsonp", | |
| crossDomain: true, | |
| success: function (response) { | |
| //do something with the json data | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var iframeId = 'somethingUnique'; | |
| var url = 'http://someotherdomain.com'; | |
| var $form = $('<form>'); | |
| $form.attr('id', 'foo'); | |
| theForm.attr('action', url); | |
| $('<iframe name="' + iframeId + '" id="' + iframeId + '" />').appendTo('body'); | |
| $("#" + attachment_id).attr('style', 'display: none;'); | |
| $("#" + attachment_id).append($form); | |
| theForm.attr('target', iframeId); | |
| theForm.attr('method', 'POST'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var iframeId = 'somethingUnique'; | |
| var url = 'http://someotherdomain.com'; | |
| var $form = $('<form>'); | |
| $form.attr('id', 'foo'); | |
| $form.attr('action', url); | |
| $('<iframe name="' + iframeId + '" id="' + iframeId + '" />').appendTo('body'); | |
| $("#" + attachment_id).attr('style', 'display: none;'); | |
| $("#" + attachment_id).append($form); | |
| $form.attr('target', iframeId); | |
| $form.attr('method', 'POST'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var $form = $('<form>'); | |
| $form.attr('id', 'foo'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var $form = $('<form id="foo">'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var iframeId = 'somethingUnique'; | |
| var url = 'http://someotherdomain.com'; | |
| var $form = $('<form>'); | |
| $form.attr('id', 'foo'); | |
| $form.attr('action', url); | |
| $('<iframe name="' + iframeId + '" id="' + iframeId + '" />').appendTo('body'); | |
| $("#" + iframeId).attr('style', 'display: none;'); | |
| $("#" + iframeId).append($form); | |
| $form.attr('target', iframeId); | |
| $form.attr('method', 'POST'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var url = 'http://someotherdomain.com?callback=someRandomCallback'; | |
| var remoteScript = document.createElement('script'); | |
| remoteScript.src = url; | |
| document.body.appendChild(remoteScript); | |
| function someRandomCallback(response) { | |
| //do something with the json data (this function must be global for this example) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express') | |
| , http = require('http') | |
| , app = express() | |
| , server = http.createServer(app); | |
| app.configure(function(){ | |
| app.use(express.static('/Users/toranb/foo/webapp')); | |
| }); | |
| app.get('/', function(req, res) { |