Thursday, October 6, 2016

[Working Code] How to Load New Web Page

How to Load New Web Page

Web Technologies:How to load new page HTML and Javascript


Replace New HTML Page

<input type="button" id="test" value="test" onclick="window.location.replace('sample.html')" />
Replace New PHP Page

<input type="button" id="test" value="test" onclick="window.location.replace('sample.php')" />
Replace New Page with parameter passing

<script
var val= "Hello";
var test= "action_sample.php?myvar=" + val;
</script>
<input type="button" value="test" onclick="window.location.replace(test)" />
Replace New Page with multiple parameter passing

window.location.replace("sample.php?myvar1=" + myvalue1+ "&myvar2=" + myvalue2);
Replace New Page with parameter passing
window.location.replace("sample.php?myvar=hello world");
Replace New Page with function Call
<script>
function MyFunc()
{
             var myvalue = "world";
             window.location.replace("func.php?myvar=" + myvalue);
}
</script>
<input type="button" id="func" value="Func" onclick="MyFunc()" />

No comments:

Post a Comment