get

Android HTTP GET Login method

馋奶兔 提交于 2019-12-07 03:44:28
I have two activities. The main activity runs the app and initialises the http get request code and parses the response from JSON into a string. The getmethod activity uses a http get method to connect to the server and sends the response back to my main activity. How can I create a log in method, where the user enters their username and password manually and this is passed onto the get method? You can add this code to your main activity - it will do all the heavy lifting for you. /** * Represents an asynchronous login/registration task used to authenticate * the user. */ public class

jQuery get variable value from another html page

僤鯓⒐⒋嵵緔 提交于 2019-12-07 03:41:32
I have got an html page with this content, called "page1.html": <div> <div id="content"> content </div> <script type="text/javascript"> var x=5; var y=2; </script> <div id="other">Some other content</div> </div> In another html page, I'd like to get the value of the variable "x" (5). This is the main page: <!DOCTYPE html> <html> <head lang="en"> <script type="text/javascript" src="app.js"></script> </head> <body> <div id="new_content"></div> </body> </html> And this is the app.js script: $(function(){ $.get('page1.html', function(result){ var obj = $(result).find('script'); $(this).append($('

PHP Using cURL and GET request in URL

做~自己de王妃 提交于 2019-12-07 03:15:14
问题 I am using cURL instead of file_get_contents, which is working fine on the URL until I used a GET request variable in place of the city on the URL below. Using cURL on the following: (Works) $url = 'http://www.weather-forecast.com/locations/London/forecasts/latest'; This works fine, however when substituting 'London' with a variable $city : URL: example.com/weather.php?city=London $city = $_GET['city']; $city = ucwords($city); $city = str_replace(" ", "", $city); $url = 'http://www.weather

Extjs Ajax file download request C# MVC

不羁的心 提交于 2019-12-07 03:04:14
问题 I want client to download a file stored on my db when clicked a button. I send this ajax request and take it from the server side. EXTJS: downloadFile: function (a, b, c) { var feed_id =this.getMyfeedwindow().down('form').getComponent('FeedId').text; Ext.Ajax.request({ url: '/Feed/Download', method: 'GET', params: { fileID: feed_id, //this.form.getComponent('file').value, }, failure: function (response) { alert('failed !'); }, success: function (response) { alert('success!'); }, }); }, then

jQuery - find not a function?

强颜欢笑 提交于 2019-12-07 02:38:19
问题 could someone please explain why the following code is throwing an error? // JavaScript Document $(document).ready(function(){ $(".port-box").css("display", "none"); $('ul#portfolio li a').bind('click', function(){ var con_id = $(this).attr("id"); if( con_id.length !== 0 ) { $.get('./act_web_designs_portfolio', function(data){ var content = data.find("#" + con_id + "-content").html(); alert(content); }); return false; } }); }); Firefox says: data.find is not a function Any help much

Facebook Application Auth Token Get Error

人走茶凉 提交于 2019-12-07 02:23:25
I am trying to request the authtoken for my app via the Facebook API Graph Exlorer following the facebooks instructions . When I do a get call with a URL with the following form: https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials I get the following error: { "error": { "message": "Invalid callback", "type": "OAuthException", "code": 1 } } Suggestions on how I might go about obtaining the access token for my app would be greatly appreciated! If I try to obtain the access code programmatically running the following code

how to pass query parameters in java with Http client

谁说我不能喝 提交于 2019-12-07 02:16:53
问题 I am using GET REST call in java using the given code, but I am getting an error code : 404 i.e Not Found . But when I am using the same URL in the browser I am getting the output and it is working fine.I new to JAVA. May be I am passing the query parameters wrongly, but I am not getting it. I am working in NETBEANS 7.1.2. Please help. import java.io.IOException; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; public class Test { private static

How to get an object that was changed in angularjs?

我怕爱的太早我们不能终老 提交于 2019-12-07 02:05:42
问题 I use this function to watch an array of objects for changes: $scope.$watch('Data', function (newVal) { /*...*/ }, true); How can I get an object in which property has been changed so that I can push it in an array? For example: var myApp = angular.module("myApp", []); myApp.factory("Data", function(){ var Data = [{id:1, property: "Random"}, {id:2, property: "Random again"}]; return Data; }); var myBigArray = []; function tableCtrl($scope, Data){ $scope.TheData = Data; $scope.$watch("TheData"

Sending form via POST results in broken GET request on webserver (405)

假装没事ソ 提交于 2019-12-07 00:33:29
Situation: Sending a HTML form (method POST) results sporadically in broken GET request on webserver (405). In the browser is displayed "Method now allowed" (405). The incorrect string in front of the wrong GET method looks like some form variables . For example checkout=Weiter+%3E%3E , which is the value-attribute of the submit button ( Weiter >> ). WA Log entries: "egoryID=vvXAqAFS1FIAAAFA6CQIDsbGGET /is-bin/WFS/XYZ-DE-Site/de_DE/-/EUR/ViewData-Start/1268826926?JumpTarget=ViewRequisitionCheckout-ShowLoginPage HTTP/1.1" 405 92 "https://www.XYZ.de/is-bin/WFS/XYZ-DE-Site/de_DE/-/EUR/ViewData

Get HTML of div element returned by .get with jQuery

主宰稳场 提交于 2019-12-06 23:48:35
I'm trying to get the HTML of a specific div returned by a .get request (the .get request, returns HTML data with 3 divs with 3 different ids) Here's my code: $.get("ajax/learn-more.html", function(data){ var $response = $(data); alert($response.find('#main-images')); // <= prints [Object object] alert("Data Loaded: " + data); // <= displaysthe whole html of learn-more.html // how can I get the html of a div in learn-more.html with id="main-images" ??? }); EDIT: The content of learn-more.html: <div id="something" class="hero-unit span-one-third" style="position: relative;"> Foo Bar </div> <div