Thank you for your help.
I am currently developing a hybrid application at Monaca.
As stated in the title, we introduced nend ads and were able to display them safely.
It was good to get to
As long as the displayed advertisement does not reload the page, no matter how many times it is displayed, the advertisement does not change at all.
If possible, I would like to change it every time I display it, but what should I do?
Currently, we use ons-modal as follows for advertising.
I show the modal when I need it.
Refresh the ad or
at this show timing
I would like to refresh myself when I hide it.
<ons-modal var="ad_modal" id="AdModal">
<divid="nend_wrapper">
<script type="text/javascript" src="https://js1.nend.net/js/nendAdLoader.js">/script>
</div>
<divid="CloseBottonDiv">
<label class="CloseBotton" onClick="AdModalHide()">Close</label>
</div>
</ons-modal>
Once I removed it from DOM and dynamically created the tag on the JS side, but
I couldn't redisplay it;;;
If anyone knows, please take care of me...
monaca nend
Inserting a script tag after displaying it in angularjs does not work, so it is solved by inserting a new nend script using angular-loadscript.js.
It's a problem on the nend side, so it's quite difficult, but after a quick look at the nend script, it seems to refresh with nendCommon.init()
.If you want to refresh the dialog when you open it,
nendCommon.init();
modal.show();
What do you think of course.
(nendCommon
is defined in https://js1.nend.net/js/nendAdLoader.js)
However, I don't know if I can use this method in the future because it doesn't seem to be a public calling method.
[Additional note]
nendCommon.init()
was not a refresh, but an initialization process.
Also, as Mr. oTak said in the comment, this alone will increase the number of unnecessary script tags, so we need to implement it to delete them.
© 2024 OneMinuteCode. All rights reserved.