For instance, to insert a value from the querystring into the page title, add the following script to the top of the PlaceHolderMain Content Place Holder block:
<script type="text/javascript" language="javascript">
function getQueryStringValue(qsName) {
var querystring = window.location.search.substring(1);
var qsPair = querystring.split("&");
for (var i=0;i<qsPair.length;i++) {
var pair = qsPair[i].split("=");
if (pair[0].toLowerCase() == qsName.toLowerCase()) {
return pair[1];
}
}
return '';
}
</script>
<script type="text/javascript" language="javascript" for="window" event="onload">
document.title = 'Details for ' + getQueryStringValue('supplier') + document.title;
</script>
1 comment:
Great post, but is there a way to use SharePoint Model Object in javascript ?
Post a Comment