execute javascript for Google Chrome = "do javascript" for Safari...

Or so I’ve been told.

And yet this doesn’t seem to successfully fill in the field I want it to:


set loginurl to "http://emailga.me/"
set mylogin to "myemailaddresswouldbehere"

set theurl to "http://emailga.me/"
tell application "Google Chrome"
	tell window 1
		tell active tab
			open location theurl
		end tell
	end tell
	
	tell window 1
		tell active tab
			execute javascript ("document.forms.input.emailinput.value = '" & mylogin & "'")
			
			execute javascript "document.forms.input.submit.click()"
		end tell
	end tell
end tell

(I can get it to work in Safari, so I’m pretty sure it isn’t a question of misnaming the javascript elements)

The script just needs a delay.

set loginurl to "http://emailga.me/"
set mylogin to "myemailaddresswouldbehere"

set theurl to "http://emailga.me/"
tell application "Google Chrome"
	tell window 1
		tell active tab
			open location theurl
		end tell
	end tell
	
	delay 3
	tell window 1
		tell active tab
			execute javascript ("document.forms.input.emailinput.value = '" & mylogin & "'")
			
			execute javascript "document.forms.input.submit.click()"
		end tell
	end tell
end tell

Thanks adayzdone.

I thought for sure I was missing something more.