Click here to Skip to main content
15,895,483 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Google API v2 is Free? Pin
Richard MacCutchan23-Sep-11 22:57
mveRichard MacCutchan23-Sep-11 22:57 
QuestionJava script -Print Pin
kathyani21-Sep-11 2:13
kathyani21-Sep-11 2:13 
AnswerRe: Java script -Print Pin
Pete O'Hanlon21-Sep-11 2:46
mvePete O'Hanlon21-Sep-11 2:46 
GeneralRe: Java script -Print Pin
kathyani21-Sep-11 2:54
kathyani21-Sep-11 2:54 
GeneralRe: Java script -Print Pin
Pete O'Hanlon21-Sep-11 3:05
mvePete O'Hanlon21-Sep-11 3:05 
JokeRe: Java script -Print PinPopular
Manfred Rudolf Bihy21-Sep-11 3:43
professionalManfred Rudolf Bihy21-Sep-11 3:43 
GeneralRe: Java script -Print Pin
Pete O'Hanlon21-Sep-11 4:47
mvePete O'Hanlon21-Sep-11 4:47 
QuestionProblem Displaying Data Island [modified] Pin
ASPnoob20-Sep-11 19:34
ASPnoob20-Sep-11 19:34 
Hi All,
I'm trying out some javascript functions and XML Data Island that I was told should work but they do not. The following is the error message that I get when I tried to display my web page in Windows 7:

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MAAU; .NET4.0C)
Timestamp: Wed, 21 Sep 2011 05:19:50 UTC

Message: Invalid character
Line: 16
Char: 53
Code: 0
URI: file:///C:/Users/Tape%20Pra%20Yuda/Desktop/PracticeWeb/SampleXML3.html

Message: Object expected
Line: 1
Char: 1
Code: 0
URI: file:///C:/Users/Tape%20Pra%20Yuda/Desktop/PracticeWeb/SampleXML3.html

I do not understand why data from the XML in the body of my html doc can not be displayed. Below are the html and javascript I'm using. Please take a look and tell me what I've done wrong, thanks in advance for your help.

<pre lang="text">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Contact Info Example1</title>
<script language="javascript" type="text/javascript">
function displayBusinessCardData() {
var xmldata1 = document.getElementById("xmldata1");
var bizCard = xmldata1.getElementsByTagName("BusinessCard")[0];

var name = "Name: " + bizCard.getElementsByTagName("Name")[0].firstChild.data;
var phone1 = "Phone:" + bizCard.getElementsByTagName("phone")[0].firstChild.data;
var phone2 = "Phone:" + bizCard.getElementsByTagName("phone")[1].firstChild.data;
var phone3 = "Phone:" + bizCard.getElementsByTagName("phone")[2].firstChild.data;
var email = "email:" + bizCard.getElementsByTagName("email")[0].firstChild.data;

alert("Contact Information: \n\n\" + name + "\n" + phone1 + "\n" + phone2 + "\n" + phone3 + "\n" + email);
}
</script>
</head>
<body>
<xml id="xmldata1" style="display:none">
<BusinessCard>
<Name> Pac Man</Name>
<phone type="mobile">(444) 123-4568</phone>
<phone type="work">(800) 111-2345</phone>
<phone type="fax">(444) 123-5678</phone>
<email>person1@dev.com</email>
</BusinessCard>
</xml>
<a href = "javascript:displayBusinessCardData()">Show Contact Info</a>
</body >
</html>

</pre>



-- Modified Wednesday, September 21, 2011 2:12 AM
AnswerRe: Problem Displaying Data Island Pin
Graham Breach20-Sep-11 21:54
Graham Breach20-Sep-11 21:54 
GeneralRe: Problem Displaying Data Island [modified] Pin
ASPnoob20-Sep-11 22:22
ASPnoob20-Sep-11 22:22 
Questionjavascript delay Pin
benams18-Sep-11 22:30
benams18-Sep-11 22:30 
AnswerRe: javascript delay Pin
Graham Breach18-Sep-11 23:20
Graham Breach18-Sep-11 23:20 
GeneralRe: javascript delay Pin
benams18-Sep-11 23:26
benams18-Sep-11 23:26 
GeneralRe: javascript delay Pin
Graham Breach18-Sep-11 23:45
Graham Breach18-Sep-11 23:45 
GeneralRe: javascript delay Pin
benams18-Sep-11 23:53
benams18-Sep-11 23:53 
GeneralRe: javascript delay Pin
Graham Breach19-Sep-11 1:41
Graham Breach19-Sep-11 1:41 
GeneralRe: javascript delay Pin
Morgs Morgan21-Sep-11 7:12
Morgs Morgan21-Sep-11 7:12 
QuestionJavaScript Native or .NET Compiler Pin
Keith.Badeau16-Sep-11 19:13
Keith.Badeau16-Sep-11 19:13 
AnswerRe: JavaScript Native or .NET Compiler Pin
twseitex17-Sep-11 8:59
twseitex17-Sep-11 8:59 
GeneralRe: JavaScript Native or .NET Compiler Pin
Keith.Badeau19-Sep-11 19:30
Keith.Badeau19-Sep-11 19:30 
GeneralRe: JavaScript Native or .NET Compiler Pin
User 171649219-Sep-11 21:30
professionalUser 171649219-Sep-11 21:30 
GeneralRe: JavaScript Native or .NET Compiler Pin
Keith.Badeau19-Sep-11 21:55
Keith.Badeau19-Sep-11 21:55 
GeneralRe: JavaScript Native or .NET Compiler Pin
twseitex20-Sep-11 6:35
twseitex20-Sep-11 6:35 
GeneralRe: JavaScript Native or .NET Compiler Pin
Keith.Badeau20-Sep-11 19:43
Keith.Badeau20-Sep-11 19:43 
QuestionHow to restrict user not to enter <> characters in text box. Pin
InderK15-Sep-11 0:04
InderK15-Sep-11 0:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.