Archive for August, 2009

How to reload or redirect a page after a definite time interval


For reloading or refreshing a page JavaScript is as follows —

window.location.reload();

and for redirect a page after define time interval in JavaScript is as follows–

<script type=”text/javascript”>
setTimeout(“location.href=’https://ruzdi.wordpress.com&#8217;,10000);
</script>

here in the setTimeout() Javascript functon first parameter is the location where to redirect and second parameter is the time interval

In Html inside the head tag use following meta tag for redirection —

<head>

<meta http-equiv=”refresh” content=”10;https://ruzdi.wordpress.com”&gt;

</head>

here in this meta tag on content 10 is the time interval and next address is the address where to redirect

How to submitting from inside of iFrame from Outside of iFrame


In case of situation like that a form which is inside of iframe but I  need to submit it from outside of iframe.

<iframe name=”displayframe” src=”display.php” width=”100%” height=”650px” style=’border:none’ >

<form action=”<?php echo $base_index.$action;?>” method=”post” enctype=”multipart/form-data” name=”formdisplay” id=”formwork”>
<input type=”hidden” id=’base’ value='<?php echo $base_index?>’ />

<table width=”522″ border=”0″ align=”center”>
<tr>
<td align=”right”><b>Title:</b></td>
<td colspan=”4″><label>
<input name=”title” type=”text” id=”title” size=”50″  />
</label></td>
</tr>
<tr>
<td align=”right”><b>Description:</b></td>
<td colspan=”4″><label>
<textarea name=”description” rows=”5″ cols=”30″ style=”width:600px” >
</textarea>
</label></td>
</tr>

</table>
</form>

</iframe>

<input type=”button” name=”insert” id=”button” onclick=”submitDisplayForm()” value=”submit” />

and my JavaScript code is

<script type=”text/javascript”>

window.frames[‘displayframe’].document.forms[‘formdisplay’].submit();

</script>

in this javascript code “displayframe” is the name of iframe and “formdisplay” is the name of form which is inside of iframe.

Thats all i have done so far.