I am developing a wp application in which there is a webbrowser which loads a web page. I want to add javascript file which fills a text box in loaded web page with some data and click on submit button. I want this javascript file to run automatically once webbrowser tool loads web page completely.
When the web browser completely loads a page, the Navigated event will fire.
In the event handler, you can execute arbitrary JavaScript code by calling theBrazza.InvokeScript( "eval", SomeJavaScriptSource ); where SomeJavaScriptSource is a variable or constant containing the JavaScript you’d like to run (just don't forget to specify IsScriptEnabled="True" in your web browser).
If your page already has any JavaScript code in it - you'll be fine, otherwise this approach wont work: that thread is old, however now in Windows Phone 8 the problem is still present :-(
Related
I am building a filemaker app that will be used in web direct only. There is a custom web map displayed in a web viewer window. I have written javascript that passes a parameter into a filemaker script (and executes it) via an XML URL based on where the user clicks on the map.
Everything is working fine, except that whenever the test script executes, the web map in the web viewer refreshes. I know that it is something in FileMaker (not in the JS/HTML of the web map) that is causing the refresh, because when I try executing the script by clicking the map on its own in a browser window (NOT in web direct/web viewer) it executes the script and does not refresh.
The script is very simple - just ( Set Field [Maps::SegId; Get ( ScriptParameter)] ). All it does is take a parameter (from JS via XML) and put it intoa box in my FileMaker layout. I don't see anything in the script that would cause the refresh either.
I have an ASP.NET web page that is called from JavaScript using:
window.open( url, '_self', ...
This ASP.NET page generates on the fly an Excel worksheet so the browser starts downloading it and then opens Excel when it is finished without leaving the caller web page (the one with the JavaScript function).
Now I want to handle all posible errors that might happen while generating the Excel document, catching the exceptions in ASP.NET and showing some error information in a JavaScript alert dialogbox.
I have tried adding in the catch block the following:
Response.Write("<script>alert('Error while generating Excel
> worksheet');</script>");
but after accepting the alert window, the browser remains in a blank page. In that situation, I would like to close the alert and remain in the calling web page in the same state as it was when it called the Excel generation ASP.NET page through JavaScript. I have tried using history.back() but this reloads the web page losing all changes the user might have done previuosly there.
My requirement is to write one script when I run the script it opens the page and fill the fields and automatically take me to next page.
For e.g. Script for www.irctc.co.in. When we login to irctc it ask the user name and password and when click on submit it redirect to next page.
I want to write a script in such a way that I just click on the script it internally does all these things and I could see the next page.
I am unable form where I should start.
I think you are looking for something like Greasemonkey: https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
Greasemonkey is a Mozilla Firefox extension that allows users to install scripts that make on-the-fly changes to web page content after or before the page is loaded in the browser.
If you use a different browser, then you can refer to: http://en.wikipedia.org/wiki/Greasemonkey#Equivalents_for_other_browsers
Check Watir - Web Application Testing in Ruby. Although it is used for automation, it might solve the purpose here. With Watir, you write scripts in ruby and execute it and then see the magic. More information can be found here
I have a website www.website.com. A web user opens website.come/article.html where there is html text, images.... and javascript content (wich is different for every user).
Now my website is wordpress powered, how can i download the final version (javascript loaded and executed) of the pages opened by my users?
I want to do that because i want to know what content javascript displays for each one of them.
Can i use a php/javascript function or is there any service which do that?
You'll need a headless browser like PhantomJS to visit the page, let the javascript run and then extract the content.
There is a PHP bridge available at https://github.com/diggin/php-PhantomjsRunner, but I don't know whether it's any good.
I'm writing an app which should load a website. After the website is loaded, I have to fire up a 2nd command to the web page, which is kind of Javascript scriptlet.
I did this manually in my browser and in generally it seems to work fine. They way I did it manually was I created two shortcuts in my browser:
the URL to this website (e.g. http://www.example.net/123456-e.aspx)
the shortcut to a Scriptlet which calls a function on this website (e.g. javascript:__doPostBack('Video_Info1$Rating_control1$lnk_star5','')).
I first click the URL shortcut and after its loaded, I fire up the 2nd shortcut.
But how can I do this in a C# application?
But, what I'm trying to do is quite the opposite I think.
I'd like to SEND a _postBack to an existing site.
I'm not writing my own site which contains a postBack control!
Let me explain a little in detail...
the site I'm loading in my app is an existing ASPX site in the web.
In this site, you'll find several _doPostback entries and in a browser, the postBack event (when I hit it manually within a bookmark/shortcut) will be send back and has its desired result (in this case, its assigning "5 stars" to tell everybody, that something is supergood ;-).
So, what I'd like to do is to write my C# App which will send this _postBack command every time I hit the OK button or some other events.
Just as it is with my link above
"javascript:__doPostBack('Video_Info1$Rating_control1$lnk_star5','')"
This is the bookmark I have on my browsers bookmark panel - a shortcut!
.... Just to be honest, its a kind of cheat, which will do an automatic voting on an external site...
My prob is now,... how can I send this _postBack straight to the site, to increase my stars?
I am not sure what exactly you are trying to achieve, The code which you are seeing (_doPastBack(..)) is actually going to invoke a server method (code in your codebehind of that page).
You can create a webpage and have an iframe and load your first page in that.The user will be able to click on any of the button and invoke the corresponding server code if there is one attached.
<html>
<body>
<iframe src="http://www.example.net/123456-e.aspx"></iframe>
</body>