Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 433
  • Last Modified:

AJAST Cross Domain Request

Starting with the sample AJAST demo located here:
http://ajast.org/ajast/ajast_demo.html 
I copy the source to my local web server and it works great.  But when I edit the source to try to GET a remote file from any other web server it fails with the message :
404: Requested resource cannot be accessed at this time.   I can't figure out what I am doing wrong.

Any suggestions would be greatly appreciated.

Thanks,
Curt
 

0
97WideGlide
Asked:
97WideGlide
  • 5
  • 5
1 Solution
 
IndianHero2001Commented:
What remote file you requested? Please paste URL.
0
 
97WideGlideAuthor Commented:
To answer your question.  I cannot get the demo program to go to ANY webpage other than the ones specified in the demo.  I even created simple php and html files on the same server and get the error above.  Shouldn't I just be able to put any other web location in and get the page?

Maybe AJAST isn't what I should be using.  Here's what I am trying to do...

I'm playing a web based game and have written some simple javascript to analyze my current game situation.  I want my local page to load my current game settings from the remote game site each time so that I don't have to bring up a separate browser, go to my game page and manually fill in my form.   The game is Kingdomgame.net and the file I am trying to load is overview.asp.  

But, just to get things going I tried to make it as simple as possible by going to several other websites to see if I could just get the first word or so of their main page.  I also created html and asp files on my own server which just displayed the word 'welcome' to see if that could be loaded and got the same error.

   
0
 
IndianHero2001Commented:
Ok, what you are trying to do is, trying to load overview.asp from a remote server using that AJAST.

Thats not going to work by simply replacing the URL with your own because thats not how its going to work.

What AJAST does is it inserts a dynamic javascript in your document. And, this javascript url is basically your overview.asp?your=abc&params=here.

So, AJAST is basically a Javascript hack to get around cross-site call security limitation of browsers.

To answer your question, you need to modify ajast.js a little bit based on your requirements and also write your own overview.asp to respond to the query.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
IndianHero2001Commented:
To elaborate more, the response from overview.asp is a Javascript code (which contains your game settings).

And, this javascript code is then executed so your game-page updates accordingly.
0
 
97WideGlideAuthor Commented:
I'm wondering if I explained myself well enough cause I'm still confused.  

At kingdomgame.net I have an account and when I login and browse to overview.asp I get a page which roughly resembles the following:

Networth: 25,546
Land:  27,893 acres
Lumber: 273,012
Stone: 45,234
...
...
...

I have written a web page in HTML/javascript which resides on my web server and spits out some results based on the parameters from kingdomgame.net/overview.asp.  It works fine but I currently have to go to kingdomgame and manually view the state of my account and key the parameters into my local page for processing.  I would like to be able to click a button on my local page and have it fetch the parameters automatically and insert them in my form under program control.

Does this make sense ?  Is AJAST what I want to be using here?  If I can't get it to work then I will just make a Java application which scrapes the data I need and processes it.  

I don't want to beat this dead horse too much so if we don't get it this time around, I'll just award points and move on.

Thanks,
Curt
 
0
 
IndianHero2001Commented:
Scraping suits well for your requirement. It will be faster to implement and less pain.
0
 
97WideGlideAuthor Commented:
That's a last resort but I'd like to keep it web enabled if at all possible.
0
 
IndianHero2001Commented:
AJAST won't work in your situation because it requires you to have control on remote server.

But what you require can be done with Jquery. Plus, you add one page on your server which does "scraping" work.

You use JQuery to load results from this back-end page. This call is made using AJAX(JQuery).

The page in your back-end will accept parameters(from querystring) and will scrap the page on remote GameServer. Then, you can update game state on your page with these results from AJAX call.
0
 
97WideGlideAuthor Commented:
Thank you.  I think that answers my question here.  I'll give it a try and if I have problems, I'll open up another question.
0
 
97WideGlideAuthor Commented:
Thanks again.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now