Send Javascript submit to a different frame

M

michael.friis

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
 
T

Thomas 'PointedEars' Lahn

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: said:
[...]
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top