Trying to run the simplest html code wont work

BlitzMax Forums/MaxGUI Module/Trying to run the simplest html code wont work

Hardcoal(Posted 2013) [#1]
Im using HtmlViewRun
and ive loaded this simple code

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

still i get error

"an error has accrued in the script on this page"

why..


GaryV(Posted 2013) [#2]
Because it is shoddy code. Go here:

http://validator.w3.org/#validate_by_input

Paste in the code you pasted in above an you will see the errors and have them explained to you.


GfK(Posted 2013) [#3]
Slightly ironic that the sourcecode above is copied/pasted from the w3schools website.

http://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro


Zethrax(Posted 2013) [#4]
Here's the code I use as a html template.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>New Document</title>

<meta name="keywords" content="">
<meta name="description" content="">

<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="robots" content="index,follow">

<style type="text/css">
</style>

<script type="text/javascript">
</script>

</head>
<body>



</body>
</html>



Hardcoal(Posted 2013) [#5]
I dont get it.
here is my test code.

Import MaxGui.Drivers

Strict 

Local window:TGadget
Local htmlview:TGadget

window=CreateWindow("My Window",30,20,600,440,,15|WINDOW_ACCEPTFILES)

htmlview=CreateHTMLView(0,0,ClientWidth(window),ClientHeight(window),window)
SetGadgetLayout htmlview,1,1,1,1 

HtmlViewRun(htmlview, LoadText("C:\test.txt"))

While WaitEvent()

	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend


the file is loading fine and the html code is as simple as it can get!

whats going on here.


skidracer(Posted 2013) [#6]
HtmlViewRun expects a script not a document. Use HtmlViewGo to get the gadget to load a document from a file.


Hardcoal(Posted 2013) [#7]
ok.. ill try