Reputation: 377
Is this
<input type="button" value="..."
onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={/Pages/Home.aspx}' ) }"
/>
the same (functionally) as
. . .
<script type="javascript/text>
function runIt() {
ddwrt:GenFireServerEvent('__commit;__redirect={/Pages/Home.aspx}' );
}
</script>
<body>
<input type="button" value="..."
onclick="runIt();" />
</body>
</html>
I don't really understand
what role the term "javascript:" in the onclick
event description serves. I mean, isn't it the default that what is in the onclick will be javascript?
what role the outer curly braces serve in the ..."javascript: {}"
.
I recognize that "ddwrt:
" is a namespace, but I am not aware of how to specify a namespace within a javascript function, which itself is located within a <script>
block.
Upvotes: 1
Views: 984
Reputation: 1
In this particular case (Sharepoint) this is NOT javascript, this is parsed by Sharepoint and translated in something like:
onclick="javascript: __doPostBack('ctl00$ctl37$g_c251e0c4_cd3d_4fc0_9028_ab565452bedd','__cancel;__redirect={https://....}')"
have a look at the result source code. That's why you can't call GenFireServerEvent in your javascript code.
Upvotes: 0