HI All,
I have below mraid tag which is not working for me. Actually when I have upload this tag in our ad server, I am not able to preview the creative.
<script src="mraid.js"></script>
<div class="celtra-ad-v3">
<img src="data:image/png,celtra" style="display: none" onerror="
(function(img) {
var params = {'channelId':'2336fe57','clickUrl':'%c','externalAdServer':'Custom'};
var req = document.createElement('script');
req.id = params.scriptId = 'celtra-script-' + (window.celtraScriptIndex = (window.celtraScriptIndex||0)+1);
params.clientTimestamp = new Date/1000;
req.src = (window.location.protocol == 'https:' ? 'https' : 'http') + '://
ads.celtra.com/8936e3a5/mraid-ad.js?';
for (var k in params) {
req.src += '&' + encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);
}
img.parentNode.insertBefore(req, img.nextSibling);
})(this);
"/>
</div>
Cab anybody help me?
Thanks,
Amit Raut
On Thursday, 27 December 2012 13:42:09 UTC+5:30, Yan Bai wrote:
Hi All,
I am working on MRAID SDK now. There is a problem on my side:
We know that SDK should provide mraid object and some necessary methods such as getState and addEventListener ASAP. So that means the mraid js should be injected into WebView before creative loaded.
After investigate ORMMA reference SDK and Mocean SDK, I see that they download the creative, insert <script src="mraidJsPath"></script> to the head of creative then load it.
Is this the only way to do that?
I tried following code on Android but failed:
mWebView.getSettings().setEnableJavascript(true);
mWebView.loadUrl("javascript:" + mraidJSString);
mWebView.loadUrl(creativePath);
--Yan