- This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
Viewing 12 posts - 1 through 12 (of 12 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Jquery get and post
I have some JavaScript that is trying to Ajax to a file on someone else’s server and I need to send post ang hat data at the same time but I can’t.
Help someone
Not sure if that’s even possible with same origin policy.
STOP SPAMMING ON CSS-TRICKS.
Did you just made an alias to piss on @Htmlmaniac?
Yes he thinks I’m a spammer. And I’m using jsonp to get round the same origin policy.
I’m using http://www.pandorabots.com/botmaster/en/home and I have access to the file with custom html for the bot but it has to be on their server.
to properly use jsonp the requested json code should be wrapped in a function call which you have to declare on your code before making the call.Also the error logged in the console could help
I am doing that but it need to send get data in the url to get to the bot and post data to send the input and session id
$.ajax({
type: “GET”,
url: “www.example.com/query?var1=value1?var2=value2?callback=callbackFunctionName”,
dataType: “jsonp”
});
give this one a try [edited insert callback in the query]
Yes but i need to do this:
$.ajax({
url: ‘http://www.pandorabots.com/pandora/talk?botid=9428f08a6e344b33’,
data: {
‘input’: text
},
dataType: ‘jsonp’,
jsonpCallback: ‘jsonp’,
type: ‘POST’,
success: function (data) {
console.log(data);
}
});
I sorted it with ajaxing to a php file witch did a curl to the file i was previously ajaxing to.