使用bookmarklet或一些jQuery函数加载脚本


Load scripts with bookmarklet or some jQuery function

我在这里有一些代码,我用这个代码渲染外部页面(类似于iframe),但我得到了一个源代码。但是当我开始我的代码,一切都很好,但一个窗口显示在那里,我不能关闭他看到的内容。下面是代码:

<?php
$url = 'http://www.kupime.com/';
$data = file_get_contents($url);
$data = '<head><base href='.$url.' target="_blank" /></head>'.$data;
echo $data;
?>

,这产生一个很好的HTML页面,但要关闭窗口,我还需要得到所有脚本与这个bookmarklet:

javascript: (function(){
    s = document.getElementsByTagName('SCRIPT');
    tx = '';
    sr = [];
    for (i = 0; i < s.length; i++) {
        with (s.item(i)) {
            t = text;
            if (t) {
                tx += t;
            }
            else {
                sr.push(src)
            };
                    }
    };
    with (window.open()) {
        document.write('<textarea%20id="t">' + (sr.join("'n")) + "'n'n-----'n'n" + tx + '</textarea><script%20src="http://jsbeautifier.org/beautify.js"></script><script>with(document.getElementById("t")){value=js_beautify(value);with(style){width="99%";height="99%";borderStyle="none";}};</script>');
        document.close();
    }
})();

,但如何实现这在我的代码上面…??? 请帮助!

这里是第一个演示(只有PHP代码)http://www.pluspon.com/get1.php

尝试使用(和脚本offcource)获取所有内容,而不是使用;

$site = fopen('http://www.google.com', 'r');
$store = 'store.php';
$stream__ = stream_get_contents($site, -1);
file_put_contents($store, $stream__, LOCK_EX);
fclose($site);
$check = file_get_contents($store);
# var_dump($check); print_r($check); var_export($check); 
# or simple... 
echo $check;