By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,384 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,384 IT Pros & Developers. It's quick & easy.

Send Javascript submit to a different frame

P: n/a
Im currently trying to build a simple extension to a website allowing
me ot have a list of users in a frame beside the actual site.
Problem is the actual website uses javascript to update the contents of
dynamic pages so a link to a user on the website is:
javascript:SubmitMain("/traveller.asp","u~14756|flag~14756")
So what i did to make the userlist is make a simple framesite with one
column for the userlist and one big coloumn for the website.
What im trying to do is to make the links in the userlist frame
(containing the javascript submit) send to the frame containing the
website so the actual javascript submit is sent on that site,
resaulting in it updating the dynamic page with the new input i called
for

If this makes sense to any of you please help me out, if it doesnt i
will be happy to try and further explain it

Jan 19 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
mi***********@gmail.com wrote:
Im currently trying to build a simple extension to a website allowing
me ot have a list of users in a frame beside the actual site.
Problem is the actual website uses javascript to update the contents
of dynamic pages so a link to a user on the website is:
javascript:SubmitMain("/traveller.asp","u~14756|flag~14756")
It should not: <URL:http://jibbering.com/faq/#FAQ4_24>
[...]
What im trying to do is to make the links in the userlist frame
(containing the javascript submit) send to the frame containing
the website so the actual javascript submit is sent on that site,
resaulting in it updating the dynamic page with the new input i
called for
SubmitMain() is /your/ method. In order to change its behavior,
you have to change its code. Since that code is unknown to this
group, only guesses are possible. Say the frame in which the
"actual site" is displayed is named "site", that could be for
example:

<script type="text/javascript">
function submitMain(baseURL, userData)
{
function isMethodType(s)
{
return (s == "function" || s == "object");
}

var esc = (isMethodType(typeof encodeURIComponent)
? encodeURIComponent
: (isMethodType(typeof escape)
? escape
: function(s) { return s; }));

window.parent.frames['site'].location =
window.location.match(/^https?:\/\/[^\/]+\//)[0]
+ baseURL.replace(/^\//, "") + "?" + esc(userData);
}
</script>
...
<a href="no_script.html"
onclick='submitMain("/traveller.asp", "u~14756|flag~14756"); return
false;'Joe User</a>


However, the same functionality could be achieved without any script:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
...
<base href="/traveller.asp" target="site">
...
</head>

<body>
<ul>
<li><a href="?u~14756%7Cflag~14756">Joe User</a></li>
...
</ul>
</body>
</html>

Since you have ASP available, that list can be generated by ASP code.
PointedEars

P.S.: The pronoun "I" is written with a capital letter always.
Feb 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.