"Ieteikt" callback funkcijas parametri?

99 views
Skip to first unread message

Sandis Milovidovs

unread,
Mar 21, 2015, 9:55:14 AM3/21/15
to draug...@googlegroups.com
Kā un vai ir iespējams padot callback funkcijai kādus parametrus?

<script type="text/javascript">
var p = {
link:"http://saite",
title:"Nosaukums",
text:"text",
onAdd: callbackFunc
};
new DApi.Like(p).append('draugiemLike');
</script>

Piemēram uzliekot onAdd: callbackFunc(kautkas) tā funkcija izpildās uzreiz ielādējot lapu, nevis, kad tiek ieteikts.

Jānis Akmentiņš

unread,
Mar 23, 2015, 4:44:09 AM3/23/15
to draug...@googlegroups.com
Sveiki!

Pamēģiniet šādi:

<script type="text/javascript" src="//www.draugiem.lv/api/api.js"></script>
<div id="draugiemLike"></div>
<script type="text/javascript">
function test(arg){
alert(arg);
}
var p = {
 onAdd:"test(1)"

};
new DApi.Like(p).append('draugiemLike');
</script>

--
You received this message because you are subscribed to the Google Groups "Draugiem.lv API developer group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to draugiemapi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sandis Milovidovs

unread,
Mar 23, 2015, 5:03:07 AM3/23/15
to draug...@googlegroups.com
Jā, paldies, šādi aizgāja :)
--



Sandis Milovidovs  
WEB development, IT
Mob.: +371 26622843
Tel.: +371 65152358

Email: sandis.m...@gmail.com


Reply all
Reply to author
Forward
0 new messages