Мне нужно, чтобы показать некоторые URL в IFRAME на моей странице ... так что я пишу:Encode URL и шоу в IFRAME
Route::get('/preview/{url}', '[email protected]');
моя функция управления:
public function preview($url) {
$url = urlencode($url);
return view('pages.preview', compact('url'));
}
и offcource моего клинка предварительный просмотр страницы (JavaScript):
function preview(){
function autoResize(id){
var newheight;
var newwidth;
if(document.getElementById){
newheight = document.getElementById(id).contentWindow.document .body.scrollHeight;
newwidth = document.getElementById(id).contentWindow.document .body.scrollWidth;
}
document.getElementById(id).height = (newheight) + "px";
document.getElementById(id).width = (newwidth) + "px";
};
var content = '<iframe id="iframe2" src="{{$url}}" style="border:0px #FFFFFF none; position: relative;left: 0px;width: 100%; height:100%; top: 0;" name="myiFrame1" scrolling="yes" frameborder="0" marginheight="0px" marginwidth="0px" height="100%" width="100%" onLoad="autoResize(iframe1);"></iframe>';
var newNode = document.createElement("DIV");
newNode.innerHTML = content;
document.body.appendChild(newNode);
};
preview();
Теперь, когда я пытаюсь что-то вроде:
http://localhost:8888/preview/http%3A%2F%2Fwww.dubaimajestic.com%2F
или
http://localhost:8888/preview/http://www.dubaimajestic.com
я получаю:
не найден Запрошенный ресурс /preview/http%3A%2F%2Fwww.dubaimajestic.com%2F не был найден на этом сервер.
Как это сделать для РАБОТЫ? Есть идеи?