Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-12-2007, 11:43 PM   PM User | #1
RexxCrow
Regular Coder

 
RexxCrow's Avatar
 
Join Date: Jul 2006
Location: California
Posts: 275
Thanks: 6
Thanked 2 Times in 2 Posts
RexxCrow has a little shameless behaviour in the past
Setting up a semi-automated form for dual iframes

I am getting really confused on this subject and have not really been able to come up w/ anything in my searches so far in this matter, but am sure that AJAX/XML is the means to accomplish it... What I am attempting to accomplish is to have two separate URL's load through two iframes in the same browser in-which two fields (a last name and a first name) that the user types in gets passed to both of the URL's within the iframes, those pages are then meant to update within the iframes and display the queries from the remote server, I am thinking this could operate like a spam bot does or in a similar fashion they are able to log into a forum filling in the fields and setup a new account on their own and even make posts, etc., so I was thinking something like this could work just as well. This is a project for work I thought would be interesting to look into, so as to cut the number of tasks we have to do by half (if this works out I plan on doing another project later that would cut it down to 1/3, eventually.)

I do not have access to ether of remote sites but I might be able to work with the techs that run them in a coordinated effort, (possibly.) I was thinking that would not be an issue, being that bots are able to function in the same manner. I can't show the actual URL's to the actual sites because the information is classified and they are Intranet sites anyways and would not show up except from where I work... but I did include some others that had fields in them just for show... thx


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"><html><head>
<title>Automated Wants Intelligence Query v1.0 - AWIQ</title><script language="javascript" type="text/javascript"><!--
var verify="active"
function zin(swap){
var chkV=document.getElementById(swap)
if(swap=='SN'){
 document.getElementById('SN').style.width='100%'
 document.getElementById('HS').style.width='0%'
 }else{
 document.getElementById('HS').style.width='100%'
 document.getElementById('SN').style.width='0%'
 }
 document.getElementById('base').style.display='none'
}
function zout(swap){
var test=verify
if (test=='active'){
 document.getElementById('SN').style.width='50%'
 document.getElementById('HS').style.width='50%'
 document.getElementById('base').style.display='block'
 }
}
function process(){
// pass fields for processing on remote server...AJAX/XML based?


}
function toggle(){
alert('test')
var test=verify
if(test=='active'){
 verify='none'
}else{
 verify='active'
 }
}
//--></script><style tyle="text/css"><!--
*{margin:0px;padding:0px}
body{white-space:nowrap;margin-left:auto;margin-right:auto;background-color:#4169E1;text-align:center;color:#F5F5F5;font-family:Arial;font-weight:bold;font-size:12px;padding-bottom:10px}
fieldset{padding:5px}
form{vertical-align:middle}
iframe{height:550px;width:50%;display:inline}
input{background-color:#000099;color:#F5F5F5;font-weight:bold}
#base{margin-left:auto;margin-right:auto;position:absolute;left:16%;bottom:0%;background-color:#4169E1;border:5px outset #000066;width:650px;padding:10px}
#wrap{margin-left:auto;margin-right:auto}
#HS{}
#SN{}
.css{background-color:#000099;font-family:Arial;font-weight:bold;border:1px ridge #B0C4DE;padding:2px 5px}
.g{color:lime}
.p{color:#FFFF00}
.hl{filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);-moz-opacity:1}
.hl:hover{filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);-moz-opacity:0.5}
//--></style></head><body><div id="wrap">
<iframe id="HS" src="http://codingforums.com/" scrolling="auto" frameborder="1" marginheight="0" marginwidth="0" onMouseOver="zin('HS')" onMouseOut="zout('HS')" ondblclick="toggle()"></iframe>
<iframe id="SN" src="http://illuminati.org/" scrolling="auto" frameborder="1" marginheight="0" marginwidth="0" onMouseOver="zin('SN')" onMouseOut="zout('SN')" ondblclick="toggle()"></iframe>
<br clear="all" />
<div id="base">
<form action="javascript:process('ln','fn')" method="post">
Last Name:&nbsp;<input type="text" name="ln" width="50" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First Name:&nbsp;<input type="text" name="fn" width="50" /><br /><br />
<input class="css hl p" type="reset" value="Purge" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="css hl g" type="submit" value="Submit" />
</form>
</div>
</div>
</body></html>
RexxCrow is offline   Reply With Quote
Old 09-13-2007, 01:35 AM   PM User | #2
RexxCrow
Regular Coder

 
RexxCrow's Avatar
 
Join Date: Jul 2006
Location: California
Posts: 275
Thanks: 6
Thanked 2 Times in 2 Posts
RexxCrow has a little shameless behaviour in the past
Also how do you go about setting up the iframes to auto-refresh? I tried everything I found searching and nothing works only getting object does not exist and permission denied errors, I tried using both name and id as well, what is up with this?

Code:
function refresh(){

//frames['HS'].location.reload(true)
//window.document.iframe[0].location.reload()
//window.top.frames['HS'].location.reload(true)
//top.window.frames[0].location.reload(true)
//top.frames['iframe'].location.reload(true);
//self.top.frames[0].location.reload(true)
//self.top.frames[1].location.reload(true)
//frames[0].getElementById('HS').location.reload()
//frames[1].getElementById('SN').location.reload()

setTimeout('refresh()',1000)
}
window.onload=function(){
refresh()
}
RexxCrow is offline   Reply With Quote
Old 09-13-2007, 01:51 AM   PM User | #3
rwedge
Regular Coder

 
Join Date: Feb 2005
Posts: 679
Thanks: 0
Thanked 16 Times in 15 Posts
rwedge is on a distinguished road
Try this:
Code:
<script type="text/javascript">
/*<![CDATA[*/
function loadIframe() {
document.getElementById('if_one').src = 'http://www.mtv.com/';
document.getElementById('if_two').src = 'http://www.nbc.com/';
setTimeout(loadIframe, 20000);
}
window.onload = loadIframe;
/*]]>*/
</script>

<iframe id="if_one" src="" style="width: 300px;height: 125px;float: left;margin: 20px;"></iframe>
<iframe id="if_two" src="" style="width: 300px;height: 125px;float: left;margin: 20px;"></iframe>
rwedge is offline   Reply With Quote
Old 09-13-2007, 01:55 AM   PM User | #4
RexxCrow
Regular Coder

 
RexxCrow's Avatar
 
Join Date: Jul 2006
Location: California
Posts: 275
Thanks: 6
Thanked 2 Times in 2 Posts
RexxCrow has a little shameless behaviour in the past
I just came across this and it seems to work but is also seems a little hokie as well...

Code:
function refresh(){
var rll=document.getElementById('HS')
var rlr=document.getElementById('SN')
rll.src=rll.src
rlr.src=rlr.src
// 15 Minutes=900000ms
setTimeout('refresh()',900000)
}
window.onload=function(){
refresh()
}
RexxCrow is offline   Reply With Quote
Old 09-13-2007, 02:01 AM   PM User | #5
RexxCrow
Regular Coder

 
RexxCrow's Avatar
 
Join Date: Jul 2006
Location: California
Posts: 275
Thanks: 6
Thanked 2 Times in 2 Posts
RexxCrow has a little shameless behaviour in the past
Quote:
Originally Posted by rwedge View Post
Try this:
Code:
<script type="text/javascript">
/*<![CDATA[*/
function loadIframe() {
document.getElementById('if_one').src = 'http://www.mtv.com/';
document.getElementById('if_two').src = 'http://www.nbc.com/';
setTimeout(loadIframe, 20000);
}
window.onload = loadIframe;
/*]]>*/
</script>

<iframe id="if_one" src="" style="width: 300px;height: 125px;float: left;margin: 20px;"></iframe>
<iframe id="if_two" src="" style="width: 300px;height: 125px;float: left;margin: 20px;"></iframe>


LOL, that is basically the same thing I happened across just a few ago, so that would work as well also then, I was hoping for the streamlined DOM version of it though, that way it uses less code, (I think.)
RexxCrow is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:43 PM.


Advertisement
Log in to turn off these ads.