I want to make a website which is containing a mobile and i want to open a website inside this interface like mobile emulator.I tried with Iframe but this is not working properly. Any idea ? thanks
Make a proxy server of your own using PHP. There are many tutorials for this online.
This is one I found using Google: http://digitizor.com/2009/01/28/make-your-own-proxy-site/
Then, just modify it to fit within the mobile frame.
Use ajax to retrieve the page. If you're using JQuery, it will be something like this:
function displayEmulator( divId )
{
$.ajax
({
url: 'emulator.php',
success: function( emulatorCode )
{
$( "#" + divId ).html( emulatorCode );
}
});
}
Note that I haven't tested the code
you can use open source proxy like PHPRoxy and change its template
If your objective is to emulate a mobile device then simple php is not enough. The problem is that the user will view the page using his browser so if the user wants to emulate an iPhone browser and he is accessing your website using Microsoft Internet Explorer then the mobile page will be rendered using Trident(the MS engine). The same goes for Opera, Chrome, Firefox...
Take a look here: http://www.opera.com/mobile/demo/. On this website you have a real mobile experience because they are using a Java applet to do the job.
So if your goal is a real mobile experience then maybe you should find something similar to what opera did(a java applet).
If you just want to show how a page will look on a specific screen size an iframe should do the job, but sometimes you'll stumble in strange javascript behavior.