PDA

View Full Version : Problem with Javascript Form


kamilo37
01-09-2010, 06:08 AM
Hi. I'm trying to figure out how a form I ran across dynamically populates its function with parameters.

I've been trying to figure it out by looking at the example on this page (http://www.somethingtoputhere.com/therunaround/index.php)(requires login).

If you don't want to visit it, here's an example.
The code before one fills the form:

<script type="text/javascript">
function callPublish(msg, attachment, action_link) {
FB.ensureInit(function () {
FB.Connect.streamPublish('', attachment, action_link);
});
}</script>
<input type="button" onclick="callPublish('',null,null);return false;" value="Preview Dialog" />

Then, code after one fills the form:

<script type="text/javascript">
function callPublish(msg, attachment, action_link) {
FB.ensureInit(function () {
FB.Connect.streamPublish('', attachment, action_link);
});
}</script>
<input type="button" onclick="callPublish('',{'name':'My website','href':'http://www.mysite.com/','description':'Visit my website','media':[{'type':'image','src':'http://www.mysite.com/cache.jpg','href':'http://www.mysite.com/'}]},null);return false;" value="Preview Dialog" />


Any help is appreciated. Thanks.

Dormilich
01-15-2010, 10:31 PM
is there a page load between the two scripts?

kamilo37
01-16-2010, 11:12 PM
Hi Dormilich. I figured it out about 4 days ago. Thanks for your reply, though.