Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: opening a browser window with post data



yes, exactly, "form.submit()" is embedded into the javascript of the temp file so that when it gets opened with 'widget.openURL' it automatically submits itself and the search is executed.

sorry for the lateness of my reply, i only sporadically check the forums.

dave


On Dec 11, 2006, at 8:26 AM, Johnny Storm wrote:

so essentially what you are doing is creating a temp file which
contains a form with all the information you need. You use
widget.openURL to open the temp file, and then I am assuming you are
using javascript to form.submit()?

Clever.

Beats my solution which was to submit the form via XMLHttpRequest,
return a token or session id, then use widget.openURL to open a script
that would access the form info using the token or session id.

Thanks

-js

On 12/10/06, David Richmond <email@hidden> wrote:

I dealt with this issue a while back, the solution I ended up using involved
writing a temp file to disk which mimics the "<form>" code from the original
html source and then opens the temp file in safari.


The final code is in the current version of my widget: "Jack of All Widgets"
(in the Search category of Apple's dashboard downloads). It saves the
temporary html file in "/tmp". If you run one of the "post" searches, like
gas price watch, and then look in /tmp you can see a sample of what the
widget produces.


hope this helps,
dave r



On Dec 7, 2006, at 3:34 PM, Johnny Storm wrote:

I wanted to have my widget be able to launch a browser window and pass
along information when it does so. The easiest way would be to use the
get method:


widget.openURL('http://www.domain.com?name=val');

but I was wondering if its possible to use post information when openning a
url?


Thanks

-js
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/daver969% 40yahoo.com


This email sent to email@hidden

Dave Richmond
email@hidden
http://homepage.mac.com/daver69
------------------------------------------------------
"It works on a complex scientific principle
known as pot luck." - The Doctor





_______________________________________________ Do not post admin requests to the list. They will be ignored. Dashboard-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.