Solved

AJAST Cross Domain Request

Posted on 2009-05-16
10
421 Views
Last Modified: 2012-05-07
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
Comment
Question by:97WideGlide
  • 5
  • 5
10 Comments
 
LVL 2

Expert Comment

by:IndianHero2001
Comment Utility
What remote file you requested? Please paste URL.
0
 
LVL 8

Author Comment

by:97WideGlide
Comment Utility
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
 
LVL 2

Expert Comment

by:IndianHero2001
Comment Utility
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
 
LVL 2

Expert Comment

by:IndianHero2001
Comment Utility
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
 
LVL 8

Author Comment

by:97WideGlide
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 2

Expert Comment

by:IndianHero2001
Comment Utility
Scraping suits well for your requirement. It will be faster to implement and less pain.
0
 
LVL 8

Author Comment

by:97WideGlide
Comment Utility
That's a last resort but I'd like to keep it web enabled if at all possible.
0
 
LVL 2

Accepted Solution

by:
IndianHero2001 earned 500 total points
Comment Utility
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
 
LVL 8

Author Comment

by:97WideGlide
Comment Utility
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
 
LVL 8

Author Closing Comment

by:97WideGlide
Comment Utility
Thanks again.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A few customers have recently asked my thoughts on Password Managers.  As Security is a big part of our industry I was initially very hesitant and sceptical about giving a program all of my secret passwords.  But as I was getting asked about them mo…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now