Page 1 of 1
modifying contents of all pages
Posted: Wed Aug 24, 2011 4:38 pm
by soujisama
I'm running a program that loads external web pages. It however has an unfixable bug where some links aren't followed correctly. I have a JavaScript file that can convert the links appropriately after the external page has been included in the same page. Problem is after these links have been followed, I can't run the script again. How can I append the script to all pages? I can't use frames btw. I have tried to make the links load in Ajax and replace the contents of a div, but that doesn't cover buttons and onclicks. Any suggestions?
Re: modifying contents of all pages
Posted: Wed Aug 24, 2011 11:53 pm
by danwguy
perhaps post up some code so we can take a gander and see if we can help
Re: modifying contents of all pages
Posted: Thu Aug 25, 2011 4:02 am
by soujisama
i wonder if this will help.
this is a sample of a page that doesnt work correctly
Code: Select all
<body>
<a href=javascript:__doPostBack("foo","bar")>click me</a>
<body>
i include it in a php file as below
Code: Select all
<script src=fix.js></script>
echo "<base href=path>"
include(path/file.htm);
the javascript modifies the link to
Code: Select all
<a href=javascript:__doPostBack("foo","bar") onclick=doPostBack("foo","bar")>click me</a>
this works in the application.
the only problem now is when a link is followed, needless to say, my include patch dissapears as it is a direct link to a file on the other server.
i can patch the anchors to link to this same proxy page so as to load the include patch again, but that will not cover for buttons and other onclick methods.
better?
thanks.