473,550 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Edit javascript in IE

Hi

Does anyone know of a way to edit "live" javascript (that i have no
control over) in IE?

Example, i visit a website and see a webpage in IE containing
Javascript. Can i edit that javascript and get IE to accept any changes
i've done to it?

So what i'm saying really, is that i want to hack the javascript served
to me from a website.

Ben

Jul 20 '05 #1
15 10140
On Sat, 20 Sep 2003 18:18:27 +0100, bengee
<po********@loc alhost.localdom ain> wrote:
Example, i visit a website and see a webpage in IE containing
Javascript. Can i edit that javascript and get IE to accept any changes
i've done to it?

So what i'm saying really, is that i want to hack the javascript served
to me from a website.


yep, loads of easy ways, easiest for simple changes on a one of basis
is just to use javascript:your Code;void 0 - the yourCode will execute
in the context of the page, and the void 0 will stop navigation.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2
Jim Ley wrote:
yep, loads of easy ways, easiest for simple changes on a one of basis
is just to use javascript:your Code;void 0 - the yourCode will execute
in the context of the page, and the void 0 will stop navigation.


I'll give that a try, thanks.

Anyway's to edit the actual code in a text editor or similar?

bengee

Jul 20 '05 #3
Ivo
Follows a bookmarklet that will a page's generated source (that is: the
source including script tags and anything the script may have contibuted to
the page) in a new window which has
1. a textarea where you can edit the code
2. an button "Apply" that overwrites the page with your edited version.
3. a "Restore" button that will attempt to, eh, restore the old page.

This the code (bookmarklet code should be all on one line):
javascript:na=o pen('','edit',' top=20,width=65 0,height='+(scr een.availHeight-
99)+',directori es,menubar,resi zable');d7c=doc ument.documentE lement.innerHTM L
;d7o=d7c;while( d7c.indexOf('<' )>-1)d7c=d7c.repla ce('<','&lt;'); na.document.w
rite('<html><he ad><title>Sourc edit
"'+document.tit le+'"</title><style>bo dy{margin:0px;b order:0px;font: m
essagebox;backg round:AppWorksp ace}input{font: messagebox;widt h:60;}textarea{ w
idth:100%;}</style><script>d 7o=opener.d7o;o nresize=r;onloa d=r;function
r(){f.ta.style. height=document .body.clientHei ght-f.ta.offsetTop-1}</script><
/head><body><for m name=f><input type=button value=Apply
onclick="opener .document.open( );opener.docume nt.write(f.ta.v alue);opener.do c
ument.close();o pener.focus()"> <input type=button value=Restore
onclick="f.ta.v alue=d7o;f.ta.f ocus()"> Sourcedit <a
href="'+locatio n.href+'">...'+ location.href.s ubstring(locati on.href.length-4
0)+'</a> ('+(b=d7o.split ('\n').length)+ ' lines,
'+Math.round(d7 o.length/b*10)/10+' cpl)<br><textar ea
id=ta>'+d7c+'</textarea></form></body></html>');na.docu ment.close();na .docum
ent.f.ta.focus( );
Follows a bookmarklet that will prompt for a javascript expression. For
example if you know a page uses a global variable called "myVar", simply
type myVar in the prompt and the current value will be returned. Or if you
wish to change a function called "myFunc", enter function myFunc(){/* new
code */} and myFunc will behave in the new way from then on.

This is the code:
javascript:func tion JSexe(){ if (valJS!='null' &&
valJS!='undefin ed')strJS=valJS ; strJS=prompt('Y our JavaScript code or
variable:',strJ S); if (strJS!=null && strJS!='' && strJS!='undefin ed'){
setTimeout('val JS=\'\'+eval(st rJS);JSexe()',1 0); }
else{valJS='';s trJS='';}}valJS ='';strJS='';JS exe();

HTH
Ivo
www.4umi.com/web/bookmarklet

"bengee" <po********@loc alhost.localdom ain> wrote in message
news:SG******** ************@wa rds.force9.net. ..
Jim Ley wrote:
yep, loads of easy ways, easiest for simple changes on a one of basis
is just to use javascript:your Code;void 0 - the yourCode will execute
in the context of the page, and the void 0 will stop navigation.


I'll give that a try, thanks.

Anyway's to edit the actual code in a text editor or similar?

bengee

Jul 20 '05 #4
JRS: In article <SG************ ********@wards. force9.net>, seen in
news:comp.lang. javascript, bengee <po********@loc alhost.localdom ain>
posted at Sat, 20 Sep 2003 19:07:04 :-
Jim Ley wrote:
yep, loads of easy ways, easiest for simple changes on a one of basis
is just to use javascript:your Code;void 0 - the yourCode will execute
in the context of the page, and the void 0 will stop navigation.


I'll give that a try, thanks.

Anyway's to edit the actual code in a text editor or similar?


For me, View Source shows a copy in Notepad; then use Notepad Save As so
that you can work on the copy in a well-chosen location on disc. To
view it, enter location in browser address bar.

Or use browser Save As, and find it with your preferred editor.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demo n.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demo n.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demo n.co.uk/batfiles.htm> - also batprogs.htm.
Jul 20 '05 #5
Dr John Stockton <sp**@merlyn.de mon.co.uk> writes:
For me, View Source shows a copy in Notepad; then use Notepad Save As so
that you can work on the copy in a well-chosen location on disc. To
view it, enter location in browser address bar.


One of the things I like about Opera, is that view source lets me edit
the source (with, e.g., notepad) directly in the cache. If I make a change
and refresh the page, I see the change in action, while pressing reload
gets the source from the server again.

-L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #6
Dr John Stockton wrote:
For me, View Source shows a copy in Notepad; then use Notepad Save As so
that you can work on the copy in a well-chosen location on disc. To
view it, enter location in browser address bar.

Or use browser Save As, and find it with your preferred editor.


Doctor

I need to be able to "reload" the javascript back into IE (website only
supports IE :-(

bengee

Jul 20 '05 #7
Lasse Reichstein Nielsen wrote:
One of the things I like about Opera, is that view source lets me edit
the source (with, e.g., notepad) directly in the cache. If I make a change
and refresh the page, I see the change in action, while pressing reload
gets the source from the server again.


This sounds like exactly the thing i need, trouble is that the website i
need to access only supports IE :-(

bengee

Jul 20 '05 #8
Dr John Stockton wrote:
For me, View Source shows a copy in Notepad; then use Notepad Save As so
that you can work on the copy in a well-chosen location on disc. To
view it, enter location in browser address bar.


Duh, i didn't fully read your post John. I'll give that a try :-)

bengee

Jul 20 '05 #9
JRS: In article <r2************ ********@wards. force9.net>, seen in
news:comp.lang. javascript, bengee <po********@loc alhost.localdom ain>
posted at Sun, 21 Sep 2003 20:34:02 :-
Dr John Stockton wrote:
For me, View Source shows a copy in Notepad; then use Notepad Save As so
that you can work on the copy in a well-chosen location on disc. To
view it, enter location in browser address bar.

Or use browser Save As, and find it with your preferred editor.


Doctor

I need to be able to "reload" the javascript back into IE (website only
supports IE :-(


That's reasonable, which is why I told you how to do it.

--
© John Stockton, Surrey, UK. ??*@merlyn.demo n.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demo n.co.uk/> - FAQish topics, acronyms, & links.

Food expiry ambiguities: <URL:http://www.merlyn.demo n.co.uk/date2k-3.htm#Food>
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3187
by: Craig | last post by:
I have a page that has a few columns and totals. I've been asked to amke sure that not only is the totals boxes readonly, they must not accept focus from the cursor. However, setting the bo to Disabled makes the font go inverted it seems. I'd like to be able to still control the colour of these boxes, both the background and foreground,...
8
2321
by: Gilles T. | last post by:
How I can get element ID in the edit mode of datagrid control? If I not in the edit mode, there are no problem. <asp:TemplateColumn ItemStyle-CssClass="grid_column_width_3" ItemStyle-HorizontalAlign="center" ItemStyle-VerticalAlign="top"> <ItemTemplate><%# CType(Container.DataItem("DateStatut"),DateTime).ToString("yyyy-MM-dd")...
2
15280
by: Ravikanth[MVP] | last post by:
Hi Check whether textbox control name is 'txtDischargeDate' or it contains automatically generated id? HTH Ravikanth >-----Original Message-----
1
1353
by: Michelle Stone | last post by:
I have a list box that I am populating (not via databinding) from some tables from my SQL database. I also have a TEXT BOX on the screen. I want to display whatever the user clicks on the list box on the edit box. I know I can do it by setting the AUTOPOSTBACK property of the list box to TRUE and by writing code to assign the .TEXT...
4
3704
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml file via some editable controls such as text boxes , option boxes etc. how can i implment this , should i use another xslt file with <INPUT>...
3
1624
by: Leo | last post by:
I have a datagrid with the first column as a Edit,Update,Cancel button column. The other 5 columns are template columns. When I click the Edit button in IE6 the row correctly displays the controls defined in the <EditItemTemplate> however when I right click and do a view source I cannot find any of the input textboxes in the source. I have...
1
1623
by: Randall Parker | last post by:
Currently in an asp:DataGrid I have a column for bringing up an edit form on a particular row and that is done by a hyperlink as follows: <asp:TemplateColumn HeaderText="Edit Record"> <ItemTemplate> <asp:HyperLink id="hyperlink1" NavigateUrl='<%# "EquipmentEdit.aspx?serial=" + DataBinder.Eval(Container, "DataItem.owner_serial_num") %>'...
0
984
by: Kaushik Gadani | last post by:
I am using VB as code behind of ASP.Net (Framework 1.1) I want to call grid's edit command through javascript. This requirements comes, when I want to facilitate user to call edit command by clicking any of the columns of particular row. Please note I can do this with help of assigning edit command to all columns but that will give hyperlink...
0
7561
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7488
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7999
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7520
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7845
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3532
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3517
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1978
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
801
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.