Hi all.
I'm using this method to run my swf in the standalone player from a wrt widget:
http://wiki.forum.nokia.com/index.ph...thank_you_page
When you exit my swf, it takes you back to the blank widget page (blank with the exception of a 'close me' button)
So i thought, rather than have a blank page i can incorporate some advertising. So i registered with Admob, and I got it all working from my mobile web page. But i cant get it to work from my widget, because i cant obtain the request headers/ip address from the client side code?
I've thought of just using an iframe and setting the source to my mobile web page, but this seems hacky.
Is there a proper way to do this somehow? Thanks.
<script type='text/JavaScript'>
//helper function to create the form
function getNewSubmitForm(){
var submitForm = document.createElement("FORM");
document.body.appendChild(submitForm);
submitForm.method = "POST";
submitForm.encoding = "application/x-www-form-urlencoded";
return submitForm;
}
//helper function to add elements to the form
function createNewFormElement(inputForm, elementName, elementValue){
var newElement = document.createElement("<input name='"+elementName+"' type='hidden'>");
inputForm.appendChild(newElement);
newElement.value = elementValue;
return newElement;
}
//function that creates the form, adds some elements
//and then submits it
function createFormAndSubmit(){
var submitForm = getNewSubmitForm();
createNewFormElement(submitForm,"rt", "0")
createNewFormElement(submitForm,"u", navigator.userAgent)
createNewFormElement(submitForm,"i", "127.0.0.1")
createNewFormElement(submitForm,"h", "%5BHTTP_HOST%5D=localhost");
createNewFormElement(submitForm,"PUBLISHER_ID", "pubid");
createNewFormElement(submitForm,"ANALYTICS_ID", "analysisid");
createNewFormElement(submitForm,"COOKIE_DOMAIN", "");
createNewFormElement(submitForm,"AD_REQUEST", "true");
createNewFormElement(submitForm,"ANALYTICS_REQUEST", "true");
createNewFormElement(submitForm,"TEST_MODE", "false");
submitForm.action= " http://r.admob.com/ad_source.php";
submitForm.submit();
}
</script>

Reply With Quote


