![]() |
Get javascript from site and run them
I am currently doing a program for a site which need me to run a certain javascript. The script do I get from a HTTP 200 response. My problem is that I have never done javascripting so I do not really know how this works, I could guess that you would use the QScriptEngine to process it.
But the bigger problem I have is that when I get the response with the script and runs it, it should try to communicate with the server. This is becuase in the <script type="text/javascript"> there is a function filter which looks like this: Code:
function filter() { Yours, |
Re: Get javascript from site and run them
Are these scripts designed to be run on Maemo or even mobile devices? This isn't really a js forum but everyone round here will help where we can.
I'm unsure what you want anyone to do. Please would you re-ask your question(s) in a really simple way so it's clear what you want - say what the situ is, in each case - describe the expected outcome - describe the actual outcome - reiterate what you want help with, including any ideas you have for the problem. Doing it in this neo-bug-report way means you'll get a result quickly. |
Re: Get javascript from site and run them
Quote:
var query is a dynamically built string where $("#daysBack").val() is most likely the value inputted or held in the html form element with 'id="daysBack"' $("#chartContainer").load("/statistics/typedistributionchart?" + query); is then calling the url query and displaying the returned HTML in a visual element with an 'id=chartContainer' If I were you I'd look at what: http://THE_SITE/statistics/typedistr...111&daysBack=2 returns, assuming a valid user ID of course. Does it return HTML? Will you need to parse out the bits you want from this markup? Does the site offer a cleaner way of getting this data? |
Re: Get javascript from site and run them
@Demolition: I know this is not a js forum but I am building the app in Qt and it will be for maemo/meego :)
Quote:
here is a picture I was in contact with the site owner before and his real api was quite limited to his own apps which were limited too. So this is the only way to go. I figured out how to save the packets to a txt file so here is the packets from GET to response. After this packets a new GET comes(which was me changing daysBack). http://pastebin.com/YjJ7Db27 Hope you guys understand this now! :) Yours, |
Re: Get javascript from site and run them
The site is returning the javascript conifguration for building the diagram in a library called Highcharts. The necessary js includes for this library will likely be at the top of html page that first loads. Look for highcharts.js or similar, it's a great charting library but does it run in Qt?
You could parse out the dataset and draw the charts yourself of course. Lmk if it wasn't clear to you where that data is. |
Re: Get javascript from site and run them
Thanks, I will look into it!
I did not mean the site was running Qt but my application that need the charts does :) |
Re: Get javascript from site and run them
Quote:
cheers |
All times are GMT. The time now is 00:37. |
vBulletin® Version 3.8.8