Click to See Complete Forum and Search --> : Script tag src attribute in WML file


Chirieac
February 20th, 2010, 06:10 AM
Hello! I want to use the script tag src attribute in a wml page:

The wml structure is like this:



<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="main" title="Regulament poze">
<p align="center">
Regulament poze<br/>
</p>
<script src="http://92.81.170.28/script.js"></script>
</wml>



The script file is not loaded. I think the src attribute it's not supported in this kind of document. But, if instead of <script src="http://92.81.170.28/script.js"></script> i use this: <script>alert('hello')</script> it's working. Is there a way I can load an external script file?

Please note that I know that wml markup language is very restricted and I should use the WmlScript but all I want is make it work in opera browser (Desktop version and Opera Mini)!

Thanks for your time, have a nice day!

Chirieac
February 20th, 2010, 06:23 AM
One solution: I could erase all document elements, than create an html page and in the body i could put an iframe element that point to that wml page. But I don't know how to do that. My first thought was to use document.innerHTML = '' to erase everythink but it's not working. How could I use to replace the wml tag with html tag and card with body so that I can load an external javascript file?

PeejAvery
February 20th, 2010, 09:45 PM
Since you are loading that file cross-domain, it will not have rights to access any DOM elements. Using an <iframe> will produce the same problems.