我试图让一个按钮操作打开一个浏览器窗口到一个特定的URL ,我想我几乎得到了它,但有一个奇怪的问题正在发生。 下面的代码打开一个新的浏览器窗口,但是将URL添加到父窗口的URL末尾。 见下文:
protected function launchPrinter_clickHandler(event:MouseEvent):void { var url:String = dataGrid2.selectedItem.ip_address; var urlRequest:URLRequest = new URLRequest(url); navigateToURL(urlRequest); }这是父URL: http://???.???.???.???/IT%20Tools-debug/Main.html
这是新创建的浏览器窗口中的URL: http://???.???.???.???/IT%20Tools-debug/15.155.205.134
如何使用url变量作为地址打开新的浏览器窗口?
I am trying to make a button action open a browser window to a particular URL and I think I've almost got it but there is a weird problem going on. The code below opens a new browser window but adds the URL to the end of the URL from the parent window. See below:
protected function launchPrinter_clickHandler(event:MouseEvent):void { var url:String = dataGrid2.selectedItem.ip_address; var urlRequest:URLRequest = new URLRequest(url); navigateToURL(urlRequest); }Here is the parent URL: http://???.???.???.???/IT%20Tools-debug/Main.html
Here is the URL from the newly created browser window: http://???.???.???.???/IT%20Tools-debug/15.155.205.134
How do I open a new browser window with just the url variable being the address?
最满意答案
尝试这个:
var url:String = "http://"+dataGrid2.selectedItem.ip_address;Try this:
var url:String = "http://"+dataGrid2.selectedItem.ip_address;更多推荐
发布评论