Phantomjs-switchtoparentframe-method

提供:Dev Guides
移動先:案内検索

PhantomJS-switchToParentFrame()

現在の子フレームの親フレームを取ります。

構文

その構文は次のとおりです-

var wpage = require('webpage').create();
wpage.switchToParentFrame();

var page = require('webpage').create();
page.open('http://localhost/tasks/framesl', function(status) {
   page.switchToParentFrame();
   console.log(page.frameName);
});

上記のプログラムは、次の output を生成します。

page2