473,770 Members | 3,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML works but javascript fails with href

6 New Member
I have javascript as follows
Expand|Select|Wrap|Line Numbers
  1. function newDoc()
  2.     {
  3.     window.location.href = "http://192.168.0.8/devit/logon.html";
  4.     }
  5.  
If I call this function from my javascript as follows
Expand|Select|Wrap|Line Numbers
  1.         newDoc();
  2.  
it fails but if called from HTML
Expand|Select|Wrap|Line Numbers
  1. <input type="button" nanme="SelectButton" id="SelectButton" value="Login" onclick="newDoc()" height="50" />
  2.  
it works.
Please tell me what I am getting wrong.
Jul 5 '13 #1
1 1355
gits
5,390 Recognized Expert Moderator Expert
what does FF or Chrome's javascript-console report as error? that will give you a hint already. otherwise we would need to see more of the code - may be you call the function before its declared or similar.
Jul 5 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
2584
by: Phil Powell | last post by:
The customer made a wild request: they want on their admin panel a textarea that will display an existing resume. This textarea, however, must have a dynamic width, one that "fills the screen width of any sized screen". Sorry but I cannot fathom how to do this! <textarea name="resume" cols="108" rows="29" wrap="physical><?= $resume ?></textarea>
7
3878
by: Randell D. | last post by:
Folks, I've found a nice menu piece of javascript that works fine when the code is included entirely inside the html page. However, when I place the javascript code outside, in its own ".js" type file, it doesn't execute. IE6 reports an error "Object expected" line 30, char 1, code 0. This is the BODY tag which I've pasted below (with carriage returns to make it easier to read). I cannot understand as to how this line could be...
1
1888
by: Bernd Liebermann | last post by:
Hi, I need some help on a simple question: I have a link that should open a new window (no action in main window), which is realized by a function that calls window.open(). The function itsself works fine, but here is the problem: 1) If I use <A HREF="openToolWindow()">LinkText</A> then the plain source code of my function is loaded into the window.
4
2146
by: JJA | last post by:
Previously, anything IE did not like threw some sort of error like "object expected", etc. Now all I get is "Done" on the status bar... I am suddenly having trouble with Internet Explorer. Both IE 7 and IE 6 behave the same way - they fail to render the page at all yet do not seem to be detecting any errors on the client side. No errors occur on the web server either. I've issued VIEW SOURCE on this blank IE screen and captured it to a...
4
2843
by: Garg | last post by:
Hi All, Can you suggest me the a good editor fot HTML and Javascript. It will be good if that also support JSP. thanks Tarun Garg
0
1120
by: coachdave | last post by:
Hi all, I have been learning asp and html and javascript by bits and pieces. Specifically I want to send a short string from my asp page to be stored on a cookie on the client's computer. I have javascript to write the cookie, and read it. My problem is getting the data from asp to the client-side javascipt. What I have been doing, and it isn't working, is sending a form down to the client with a hidden input. The html is within Response.Write...
2
1423
by: anthriksh2000 | last post by:
Hi, Could someone help in getting solution of the below problem? Accept any two numbers using text box. Provide four buttons Add, Divide, Square, and Modulus (remainder of division). On clicking corresponding button, display the relevant result in new window. using the HTML and Javascript
6
1631
by: Saad Alam | last post by:
Hi, I am developing a web application using asp.net 3.5 and testing in IE 6. I want to make sure that my html looks the same in all browsers and the javascript also performs same functionality in all browsers or at least in IE 6, IE 7 and FireFox2.0. How can i achieve this ? It would be very nice of you if u can provide me a link where comparison of html and javascript for most of the modern browsers is provided. Thanks in advance, ...
2
7881
by: ray | last post by:
I have a html file stored as the D:/proj/test.html. In the html file I wish to load a javascript file---test.js which is stored in the same directory as test.html. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/ <TITLE>Test Page</TITLE>
3
3200
by: eelco.v987 | last post by:
Hello, I am buildig a website, which uses javascript for several features such as fieldvalidation, popupwindows etc. Currently I am using <a href="#foo" onClick="Validate('form_comment_fieldname')">Validate</amainly becuase I do not want to openly show the variables in the browser. In the case of a popup I have this: <a href="#foo" onClick="Validate('http://www.mysite.com/helpdocs/ donotopen/chapter1/index15.html)">Chapter 1 support</a>
0
9425
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10002
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5312
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3970
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
3
2816
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.