You can use loadURI from javascript with one argument, just ignore referrer
and charset untill you really need them.
browserElement.loadURL("http://www.yahoo.com")
Make sure you call loadURI after browser element is loaded, for example on
window load event or some button click.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<button height="200" label="go to Yahoo"
oncommand="netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');document.getElementById('browserID').loadURI('
http://www.yahoo.com')"/>
<browser id="browserID" type="content" src="http://www.google.com.br/"
flex="1" />
</window>
I used privilegemanager to test this from xul file loaded in browser, but if
you writing extension you already have rights
On Wed, Oct 27, 2010 at 5:07 PM, Tom Brito <[email protected]> wrote:
> Hi there!
>
> I'm trying to use the function loadURI( uri, referrer, charset
> )<https://developer.mozilla.org/en/XUL/Method/loadURI>,
> but I have low knowledge about web, and I really don't know what does it
> means with "referrer" and what charset should I use. I think most web sites
> use UTF-16, right? And what should I pass to "referrer"?
>
> I just want to load "google.com".
>
> *My Xul file:*
>
> <window sizemode="maximized" hidechrome="true" id="browserWindow"
> title="Window"
> onload="window.opener.close();
> document.getElementById('browserID').focus();"
> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
> <browser id="browserID" type="content" src="http://www.google.com.br/"
> flex="1" />
> </window>
>
> *My javascript:*
>
> var element = document.getElementById('browserID');
> dump('element = ' + element.nodeName + '\n');
> element.loadURI("www.google.com", "", "UTF-16");
>
> *The console output:*
>
> Error: element.loadURI is not a function
>
>
> *
>
> Any hint how to load the page?
>
>
> []s
>
> Wellington B. de Carvalho
> *
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America
> contest
> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
> marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> XUL News Wire - http://xulnews.com
> XUL Job Postings - http://xuljobs.com
> Open XUL Alliance - http://xulalliance.org
> _______________________________________________
> xul-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xul-talk
>
>
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
XUL News Wire - http://xulnews.com
XUL Job Postings - http://xuljobs.com
Open XUL Alliance - http://xulalliance.org
_______________________________________________
xul-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xul-talk