- // JavaScript Document
-
var easy = "046280000500600740200000000005032070021000480030170500000000005094001007000096830";
-
var easySplit = easy.split('');
-
var eAns = "946287351583619742217543698865432179721965483439178526678324915394851267152796834";
-
var eAnspl = eAns.split('');
-
var medium = "000800017430000000002000900200008000097603480000700005006000100000000048580001000";
-
var medSplit = medium.split('');
-
var medAns = '659824317431597826872136954265948731197653482348712695926485173713269548584371269';
-
var mAnspl = medAns.split('');
-
var hard = "900001050765000000100300008000006040000218000090400000600004002000000837030100005";
-
var hardSplit = hard.split('');
-
var hardAns = '983721654765849321124365798817956243346218579592473186678534912451692837239187465';
-
var hAnspl = hardAns.split('');
-
-
var sudokuTable = {
-
-
nonjsTable:function()
-
{
-
document.forms['sudo'].reset();
-
var table = document.getElementById('sudoForm');
-
var inp = table.getElementsByTagName('input');
-
for(var i=0; i<81; i++){
-
-
inp[i].setAttribute('id', (i+1));
-
inp[i].setAttribute('readonly', 'true');
-
inp[i].setAttribute('onchange', 'levels.change(this.id)');
-
}
-
}
-
-
}
-
-
-
// deals with function to load numbers for each level
-
-
var levels = {
-
eCheck : easy.split(''),
-
mCheck : medium.split(''),
-
hCheck : hard.split(''),
-
box : null,
-
current : null,
-
lev : null,
-
levnans : null,
-
//cell : document.getElementById('sudoForm'),
-
-
cLevels:function(levSplit, answer)
-
{
-
levels.levans = answer;
-
levels.lev = levSplit;
-
levels.eCheck = easy.split('');
-
document.forms['sudo'].reset();
-
-
for(var i=0; i<81; i++)
-
{
-
if(levSplit[i]==0)
-
{
-
document.forms['sudo'].elements[i].setAttribute('value', '');
-
document.forms['sudo'].elements[i].removeAttribute('readonly');
-
}
-
else
-
{
-
document.forms['sudo'].elements[i].setAttribute('value', levSplit[i]);
-
document.forms['sudo'].elements[i].setAttribute('readonly', 'true' );
-
}
-
-
}
-
-
},
-
-
change:function(d)
-
{
-
levels.box = document.getElementById(d);
-
levels.current = levels.levans[d-1];
-
if(levels.box.value==0)
-
{
-
levels.box.value = '';
-
}
-
},
-
-
check:function()
-
{
-
if(levels.box.value==levels.current)
-
{
-
alert('The value is correct');
-
}
-
else
-
{
-
alert('incorrect value..please try again');
-
}
-
}
-
-
-
-
}
I would say i am a novice at javascript and i had this project to do for university for a sudoku game. The code works fine in firefox but tells me that levels.box is null or not an object for some reason. It would be great if someone could help me out as i am not sure why IE does this. Thanks in advance for your help.
Moj
21 38489
found a solution. basically Internet Explorer is crappy and doesnt like the setAttribute property so had to change the onchange handler by directly changing the attrbute for the object like so.
object.onchange = function() {}
Incase anyone has a problem like this i hope the solution helps
Moj
Hi,
Would you be able to paste in your new code. I'm having the exact same problem, I just don't know how to apply what you wrote: object.onchange=function(){}.
Thanks
grim
found a solution. basically Internet Explorer is crappy and doesnt like the setAttribute property so had to change the onchange handler by directly changing the attrbute for the object like so.
object.onchange = function() {}
Incase anyone has a problem like this i hope the solution helps
Moj
acoder 16,027
Recognized Expert Moderator MVP
Hi,
Would you be able to paste in your new code. I'm having the exact same problem, I just don't know how to apply what you wrote: object.onchange=function(){}.
Thanks
grim
Welcome to TSDN!
I am assuming he meant line 26 which would be changed to: - inp[i].onchange = function() {...
If you can't solve it post your code (using code tags please).
I'm working on a piece of code... I can't get it work with IE, but in FF all is fine...
I think the problem is what you're talking about here, but I can't understand what to do with my code...
Here it is: - <?php
-
// Google Maps Mod
-
// by
-
// TLM --- Taken Over By brianjw <brianjw@verizon.net>
-
-
// We calling this directly, if so, your evil...
-
if (!defined('SMF'))
-
die('Hacking attempt...');
-
-
function Map() {
-
global $db_prefix, $context;
-
-
// Are we allowed to view the map? Keep in mind here we should be a guest unless user is in IE!
-
isAllowedTo('googleMap_view');
-
-
-
//Lets try this to make it work on first click...
-
//loadUserSettings();
-
writeLog();
-
-
//Map using the internal XML File? Or the JS file?
-
if (isset($_GET['sa']) && $_GET['sa'] == '.xml')
-
return MapsXML();
-
if (isset($_GET['sa']) && $_GET['sa'] == '.js')
-
return MapsJS();
-
-
// Get the template ready.... not really much else to do.
-
//loadLanguage('MemberMap');
-
loadTemplate('GoogleMap');
-
$context['sub_template'] = 'map';
-
$context['page_title'] = "Mappa Utenti";
-
}
-
-
function MapsJS() {
-
global $db_prefix, $context, $scripturl, $txt, $modSettings, $user_info;
-
-
// Lets dump everything in the buffer and start clean and new and fresh
-
ob_end_clean();
-
if (!empty($modSettings['enableCompressedOutput']))
-
@ob_start('ob_gzhandler');
-
else
-
ob_start();
-
-
echo '
-
// arrays to hold copies of the markers and html used by the sidebar
-
// because the function closure trick doesnt work there
-
var gmarkers = [];
-
var htmls = [];
-
-
// This function picks up the click and opens the corresponding info window
-
function myclick(i) {
-
gmarkers[i].openInfoWindowHtml(htmls[i]);
-
}
-
-
function MakeMap() {
-
// Globals.
-
//Icon(s), and if gender is enabled, php will allow those to be defined.
-
var icon = new GIcon();
-
icon.image = "http://labs.google.com/ridefinder/images/mm_20_green.png";
-
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
-
icon.iconSize = new GSize(12, 20);
-
icon.shadowSize = new GSize(22, 20);
-
icon.iconAnchor = new GPoint(6, 20);
-
icon.infoWindowAnchor = new GPoint(5, 1);
-
// For that lovly clustering thing!
-
var clusterIcon = new GIcon();
-
clusterIcon.image = "http://labs.google.com/ridefinder/images/mm_20_purple.png";
-
clusterIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
-
clusterIcon.iconSize = new GSize(12, 20);
-
clusterIcon.shadowSize = new GSize(22, 20);
-
clusterIcon.iconAnchor = new GPoint(6, 20);
-
clusterIcon.infoWindowAnchor = new GPoint(5, 1);';
-
if ($modSettings['googleMapsPinGender'])
-
echo '
-
var iconm = new GIcon();
-
iconm.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
-
iconm.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
-
iconm.iconSize = new GSize(12, 20);
-
iconm.shadowSize = new GSize(22, 20);
-
iconm.iconAnchor = new GPoint(6, 20);
-
iconm.infoWindowAnchor = new GPoint(5, 1);
-
var iconf = new GIcon();
-
iconf.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
-
iconf.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
-
iconf.iconSize = new GSize(12, 20);
-
iconf.shadowSize = new GSize(22, 20);
-
iconf.iconAnchor = new GPoint(6, 20);
-
iconf.infoWindowAnchor = new GPoint(5, 1);';
-
-
echo '
-
if (GBrowserIsCompatible()) {
-
// this variable will collect the html which will eventually be placed in the sidebar
-
var sidebar_html = "";
-
-
var i = 0;
-
-
// A function to create the marker and set up the event window
-
function createMarker(point, icon, name, html) {
-
var marker = new GMarker(point, icon);
-
GEvent.addListener(marker, "click", function() {
-
map.getCenter(point);
-
marker.openInfoWindowHtml(html);
-
});
-
// save the info we need to use later for the sidebar
-
gmarkers[i] = marker;
-
htmls[i] = html;
-
// add a line to the sidebar html';
-
if ($modSettings['googleSidebar'] == 1)
-
echo '
-
sidebar_html += \'<a href="javascript:myclick(\' + i + \')">\' + name + \'</a><br /> \';';
-
if ($modSettings['googleSidebar'] == 2)
-
echo '
-
sidebar_html += \'<a href="javascript:myclick(\' + i + \')">\' + name + \'</a>, \';';
-
echo '
-
//Now that we cached it lets return the marker....
-
i++;
-
return marker;
-
}
-
-
// create the map
-
var map = new GMap2(document.getElementById("map"));
-
map.addControl(new GLargeMapControl());
-
map.addControl(new GMapTypeControl());
-
// Sets the map type based on admin prefrence API 1 !!!
-
//map.setMapType(' . $modSettings['googleMapsType'] . ');
-
//Kartenübersicht
-
map.addControl(new GOverviewMapControl(new GSize(100,75)));
-
// Lets load up the default long/lat/zoom for the map for those that like wine.
-
map.setCenter(new GLatLng(' . $modSettings['googleMapsDefaultLat'] . ', ' . $modSettings['googleMapsDefaultLong'] . '), ' . $modSettings['googleMapsDefaultZoom'] . ',' . $modSettings['googleMapsType'] . ');
-
-
// This is so we can try to cluster some of those pins together so the map does not get over loaded?
-
var clusterer = new Clusterer( map );
-
clusterer.icon = clusterIcon;
-
clusterer.minMarkersPerClusterer = ' . $modSettings['googleMapsMinMarkerCluster'] . ';
-
clusterer.maxVisibleMarkers = ' . $modSettings['googleMapsMaxVisMarker'] . ';
-
clusterer.GridSize = ' . $modSettings['googleMapsMaxNumClusters'] . ';
-
clusterer.MaxLinesPerInfoBox = ' . $modSettings['googleMapsMaxLinesCluster'] . ';
-
-
// Read the data
-
var request = GXmlHttp.create();
-
request.open("GET", "'. $scripturl . '?action=googlemap;sa=.xml", true);
-
-
request.onreadystatechange = function() {
-
if (request.readyState == 4) {
-
var xmlDoc = request.responseXML;
-
// obtain the array of markers and loop through it
-
var markers = xmlDoc.documentElement.getElementsByTagName("marker");
-
-
for (var i = 0; i < markers.length; i++) {
-
// obtain the attribues of each marker
-
var lat = parseFloat(markers[i].getAttribute("lat"));
-
var lng = parseFloat(markers[i].getAttribute("lng"));
-
var point = new GLatLng(lat,lng);
-
var html = markers[i].getAttribute("html");
-
var label = markers[i].getAttribute("label");
-
// create the marker';
-
if ($modSettings['googleMapsPinGender'])
-
echo '
-
if (parseFloat(markers[i].getAttribute("gender")) == 0)
-
var marker = createMarker(point, icon, label, html);
-
if (parseFloat(markers[i].getAttribute("gender")) == 1)
-
var marker = createMarker(point, iconm, label, html);
-
if (parseFloat(markers[i].getAttribute("gender")) == 2)
-
var marker = createMarker(point, iconf, label, html);';
-
else
-
echo '
-
var marker = createMarker(point, icon, label, html);';
-
if ($modSettings['googleMapsEnableClusterer'])
-
echo '
-
clusterer.AddMarker(marker, label);';
-
else
-
echo '
-
map.addOverlay(marker);';
-
echo '
-
}
-
// put the assembled sidebar_html contents into the sidebar div
-
document.getElementById("sidebar").innerHTML = sidebar_html;
-
}
-
}
-
request.send(null);
-
} else {
-
alert("Sorry, the Google Maps API is not compatible with this browser");
-
}
-
}
-
setTimeout(\'MakeMap()\', 500);
-
';
-
obExit(false);
-
}
Can you help me, please?
Bye,
PS
acoder 16,027
Recognized Expert Moderator MVP
A bug in the code tag software means that the code will have to be split up across multiple posts. Here's the second part: - function MapsXML() {
-
global $db_prefix, $context, $scripturl, $txt, $modSettings, $user_info, $themeUser, $memberContext;
-
-
// Lets dump everything in the buffer and start clean and new and fresh
-
ob_end_clean();
-
if (!empty($modSettings['enableCompressedOutput']))
-
@ob_start('ob_gzhandler');
-
else
-
ob_start();
-
-
// XML Header
-
//header("Content-Type: plain/text; charset=UTF-8");
-
header("Content-Type: application/xml; charset=UTF-8");
-
-
// Lets find number of members that set there map
-
$request = db_query("
-
SELECT COUNT(*) as TOTALFOUND
-
FROM {$db_prefix}members
-
WHERE latitude IS NOT NULL AND longitude IS NOT NULL
-
", __FILE__, __LINE__);
-
-
// Pull the answer and store it...
-
$totalSet = mysql_fetch_row($request);
-
-
// If the total people set there lat/long is greater than googleMapsPinNumber,
-
// We check for if we have any bounds that got passed from the JS,
-
// If no bounds we just pick the number of googleMapsPinNumber to show...
-
// If we are under the max allowed, just show them all!
-
if ($totalSet[0] >= $modSettings['googleMapsPinNumber']) {
-
// Lets set this to nothing, just to be safe if we dont have variables...
-
$sql_addon = "";
-
-
// Check to see if we have any ranges before we add to the SQL statment...
-
// This could stand to have a bit better security on it but its gonna be let by the side for now
-
if ((isset($_GET['minX'])) && (isset($_GET['maxX'])) && (isset($_GET['minY'])) && (isset($_GET['maxY']))) {
-
$sql_addon = " AND latitude > " . $_GET['minX'] . "
-
AND latitude < " . $_GET['maxX'] . "
-
AND longitude > " . $_GET['minY'] . "
-
AND longitude < " . $_GET['maxY'];
-
}
-
-
// Lets just make this simple for the query...
-
$maxPins = $modSettings['googleMapsPinNumber'];
-
-
// Load the data up at random to the ping count!
-
$query = "SELECT *
-
FROM {$db_prefix}members
-
WHERE latitude IS NOT NULL AND longitude IS NOT NULL
-
$sql_addon
-
ORDER BY RAND()
-
LIMIT 0, $maxPins";
-
} else {
-
// Looks like we passed under the max, Load everyone...
-
$query = "SELECT *
-
FROM {$db_prefix}members
-
WHERE latitude IS NOT NULL AND longitude IS NOT NULL
-
ORDER BY `realName` ASC ";
-
}
-
-
$request = db_query($query, __FILE__, __LINE__);
-
-
//Ok this is block of code takes care of the entire load all member data into $themeUser/$memberContext on per # basis
-
$temp = array();
-
while ($row = mysql_fetch_array($request, MYSQL_ASSOC))
-
$temp[] = $row['ID_MEMBER'];
-
loadMemberData($temp);
-
foreach ($temp as $v)
-
loadMemberContext($v);
-
-
// Seeing how SMF 1.0 uses $themeUser and SMF 1.1 uses $memberContext, lets just make our own now?
-
if (isset($memberContext))
-
$data = $memberContext;
-
elseif (isset($themeUser))
-
$data = $themeUser;
-
-
// Lets accualy start making XML Mr. PHP
-
echo '<?xml version="1.0" encoding="UTF-8"?>
-
<markers>';
-
-
if (isset($data)) {
-
// Assuming we have data to work with...
-
foreach ($data as $marker) {
-
$datablurb = '
-
<table class="googleMaps" border="0">
-
<tr>
-
<td style="white-space: nowrap;" align="left"><a href="' . $marker['online']['href'] . '"><img src="' . $marker['online']['image_href'] . '" alt="' . $marker['online']['text'] .'" class="avatar" border="0" /></a> <a href="' . $marker['href'] .'">' . $marker['name'] . '</a></td>
-
<td rowspan="3">' . $marker['avatar']['image'] . '</td>
-
</tr><tr>
-
<td style="white-space: nowrap;"><font color="#000000">' . $marker['title'] . '</font></td>
-
</tr><tr>
-
<td style="white-space: nowrap;" align="center">
-
' . $marker['icq']['link'] . '
-
' . $marker['aim']['link'] . '
-
' . $marker['yim']['link'] . '
-
' . $marker['msn']['link'] . '
-
</td>
-
</tr><tr>
-
<td style="white-space: nowrap;" colspan="2" align="left">';
-
if (($marker['website']['url'] != '') && ($marker['website']['title'] != ''))
-
$datablurb = $datablurb . '<a href="' . $marker['website']['url'] . '">' . $marker['website']['title'] . '</a>';
-
$datablurb = $datablurb . '</td>
-
</tr><tr>
-
<td style="white-space: nowrap;" colspan="2" align="left"><font color="#000000">' . $marker['blurb'] . '</font></td>
-
</tr>
-
</table>';
-
-
// This is to help against those funky chars... and protect against those " errors in XML!
-
$datablurb = htmlspecialchars($datablurb);
-
-
// Lets bring it all together...
-
$markers = '<marker lat="' . $marker['googleMap']['latitude'] . '" lng="' . $marker['googleMap']['longitude'] . '" ';
-
-
if ($marker['gender']['name'] == $txt[238]) {
-
$markers = $markers . 'gender="1"';
-
} elseif ($marker['gender']['name'] == $txt[239]) {
-
$markers = $markers . 'gender="2"';
-
} else {
-
$markers = $markers . 'gender="0"';
-
}
-
-
$markers = $markers . ' label="' . $marker['name'] . '" html="'. $datablurb . '" />';
-
-
echo $markers;
-
}
-
}
-
echo '
-
</markers>';
-
-
// Ok we should be done with output, dump it to user...
-
obExit(false);
-
}
acoder 16,027
Recognized Expert Moderator MVP
And the final part: -
function ShowKML () {
-
global $db_prefix, $context, $scripturl, $txt, $modSettings, $user_info, $mbname, $themeUser, $memberContext;
-
-
// Are we allowed to view the map? Keep in mind here we should be a guest unless user is in IE!
-
isAllowedTo('googleMap_view');
-
-
// If it's not enabled, die.
-
if (empty($modSettings['xmlnews_enable']))
-
obExit(false);
-
-
// This is an kml file, its like an XML file...
-
ob_end_clean();
-
if (!empty($modSettings['enableCompressedOutput']))
-
@ob_start('ob_gzhandler');
-
else
-
ob_start();
-
-
// Lets make sure its sent as KML
-
header('Content-type: application/keyhole;');
-
-
// It will be called ourforumname.kml
-
header('Content-Disposition: attachment; filename="' . $mbname . '.kml"');
-
-
// Load the data up, and seeing how its google earth, lets just send everything.
-
// If we get complaints about this, then we shall have to figure out how to limit it.
-
$request = db_query("
-
SELECT *
-
FROM {$db_prefix}members
-
WHERE latitude IS NOT NULL AND longitude IS NOT NULL
-
", __FILE__, __LINE__);
-
-
//Ok this is block of code takes care of the entire load all member data into $memberContext on per # basis
-
$temp = array();
-
while ($row = mysql_fetch_array($request, MYSQL_ASSOC))
-
$temp[] = $row['ID_MEMBER'];
-
loadMemberData($temp);
-
foreach ($temp as $v)
-
loadMemberContext($v);
-
-
// Seeing how SMF 1.0 uses $themeUser and SMF 1.1 uses $memberContext, lets just make our own now?
-
if (isset($memberContext))
-
$data = $memberContext;
-
elseif (isset($themeUser))
-
$data = $themeUser;
-
-
echo '<?xml version="1.0" encoding="UTF-8"?>
-
<kml xmlns="http://earth.google.com/kml/2.0">
-
<Folder>
-
<name>' . $mbname . '</name>
-
<open>0</open>';
-
if (isset($data)) {
-
// Assuming we have data to work with...
-
foreach ($data as $marker) {
-
echo '
-
<Placemark>
-
<description>
-
<![CDATA[';
-
echo '
-
<table class="googleMaps" border="0" style="white-space: nowrap;">
-
<tr>
-
<td style="white-space: nowrap;" align="left"><a href="' . $marker['online']['href'] . '"><img src="' . $marker['online']['image_href'] . '" alt="' . $marker['online']['text'] .'" class="avatar" border="0" /></a> <a href="' . $marker['href'] .'">' . $marker['name'] . '</a></td>
-
<td rowspan="3">' . $marker['avatar']['image'] . '</td>
-
</tr><tr>
-
<td style="white-space: nowrap;">' . $marker['title'] . '</td>
-
</tr><tr>
-
<td style="white-space: nowrap;" align="center">
-
' . $marker['icq']['link'] . '
-
' . $marker['aim']['link'] . '
-
' . $marker['yim']['link'] . '
-
' . $marker['msn']['link'] . '
-
</td>
-
</tr><tr>
-
<td style="white-space: nowrap;" colspan="2" align="left">';
-
if (($marker['website']['url'] != '') && ($marker['website']['title'] != ''))
-
echo '<a href="' . $marker['website']['url'] . '">' . $marker['website']['title'] . '</a>';
-
echo ' </td>
-
</tr><tr>
-
<td style="white-space: nowrap;" colspan="2" align="left">' . $marker['blurb'] . '</td>
-
</tr>
-
</table>';
-
echo '
-
]]>
-
</description>
-
<name>' . $marker['name'] . '</name>
-
<LookAt>
-
<longitude>' . $marker['googleMap']['longitude'] . '</longitude>
-
<latitude>' . $marker['googleMap']['latitude'] . '</latitude>
-
<range>15000</range>
-
</LookAt>
-
<styleUrl>root://styles#default+icon=0x304</styleUrl>';
-
/* This does not appeal to me right now...
-
if ($modSettings['googleMapsPinGender']) {
-
echo '
-
<Style>
-
<IconStyle>
-
<color>';
-
if ($marker['gender']['name'] == "Male") {
-
echo 'ffff6464';
-
} elseif ($marker['gender']['name'] == "Female") {
-
echo 'ff6464ff';
-
} else {
-
echo 'ff64ff64';
-
}
-
echo ' </color>
-
</IconStyle>
-
</Style>';
-
}
-
*/
-
-
echo '
-
<Point>
-
<extrude>1</extrude>
-
<altitudeMode>absolute</altitudeMode>
-
<coordinates>' . $marker['googleMap']['longitude'] . ',' . $marker['googleMap']['latitude'] . ',8000</coordinates>
-
</Point>
-
</Placemark>';
-
}
-
}
-
-
echo '
-
</Folder>
-
</kml>';
-
// Ok done, should send everything now..
-
obExit(false);
-
}
-
?>
acoder 16,027
Recognized Expert Moderator MVP
Welcome to TSDN!
I'm working on a piece of code... I can't get it work with IE, but in FF all is fine...
I think the problem is what you're talking about here, but I can't understand what to do with my code...
Phew! A lot of code to decipher! So, is that the error that you're getting (null or not an object)? Which line does it occur on?
The error occours on line 147 of the first chunk of code... But I'm realizing it could be related to the header of the XML file created by function on line 1 of the second chunk... I've inserted a test point and IE goes in Quirk Mode, so I think it's not recognizing any XML to process in that file... FF goes straight like a train!
Can you help me with this?
Bye and thanks for your greetings,
PS
EDIT: I think I must add this: - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
To the XML page created by function but I dunno how to do it...
acoder 16,027
Recognized Expert Moderator MVP
Check if responseXML is correct by alerting it. Is it as you expect it to be?
It's an XML document, so the XML prolog that you already have should be fine.
I can't understand what I have to do... Can you post the code? I'm not a PHP programmer, I just took that code and trying to make it work...
Tnx,
PS
EDIT: I found this link http://dean.edwards.name/weblog/2006/04/easy-xml/
It has an interesting chunk of code (the last one); could you help me arranging it to be suitable for my function?
acoder 16,027
Recognized Expert Moderator MVP
Between lines 145 and 147, add an alert: alert(xmlDoc). Is it the expected XML?
This is what it does with FireFox:
???
And this is with IE:
But the best thing is that now, when I click OK in the alert box with IE, the code works as it is expected to do! What could be then? Timings problems? How could then I solve?
Tnx,
PS
acoder 16,027
Recognized Expert Moderator MVP
But the best thing is that now, when I click OK in the alert box with IE, the code works as it is expected to do! What could be then? Timings problems? How could then I solve?
That's strange. The ready state is already 4, so the alert shouldn't make a difference. If you check the documentElement, is that also an object?
One other thing, for responseXML to work, the mime-type should be "text/xml". You have set it to "application/xml". I don't know if that makes a difference.
That's strange. The ready state is already 4, so the alert shouldn't make a difference. If you check the documentElement, is that also an object?
Yes it is.
One other thing, for responseXML to work, the mime-type should be "text/xml". You have set it to "application/xml". I don't know if that makes a difference.
I did already change it...
But now it comes the unbelievable thing:
I've just removed the alert(XmlDoc); and all is working fine even with IE... I'm going mad! I was trying to get it working for a week, and now it works by its own??? Too bad... Ah, I've empty browser cache, cookies and all temp files every time I tried something new...
So I can say problem solved... Thank you very very much!
Bye,
PS
acoder 16,027
Recognized Expert Moderator MVP
It must've been something else that you changed.
Anyway, glad to hear that you got it working. Post again if you have any more JavaScripting problems and someone should be at hand to solve them.
I don't know if it's related but a post above made me wonder if the OP is aware that IE does not recgonize XHTML.
I can't understand... What does OP stands for?
acoder 16,027
Recognized Expert Moderator MVP
I don't know if it's related but a post above made me wonder if the OP is aware that IE does not recgonize XHTML.
I don't think the original problem had anything to do with XHTML. That was answered by the OP himself. IE does not set event handlers (onchange, onclick, etc.) with setAttribute unlike other browsers (tell me something new!). Are you talking about post #9 here?
Are you talking about post #9 here?
Yes, that's what caught my eye.
acoder 16,027
Recognized Expert Moderator MVP
Yes, that's what caught my eye.
It was unnecessary anyway - it wasn't XHTML, just XML.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jim Marquardson |
last post by:
Hi,
I've struggled with this for a while now, so I'm asking for help. I
am trying to click on a link in one page, have that link open up in a
new window, and set that newly opened window's...
|
by: faylau |
last post by:
Hi,
I copied some javascript code off of this group to keep a banner in
view as the user scrolls down the page. The code works fine in Firefox
and Netscape but not in IE. Just wondering if...
|
by: CalgaryWebGuy |
last post by:
Please help,
My class assignment is due today and I am all finished except for one
small portion.
The instructor wants us to import a script from somewhere else, and for
some reason I...
|
by: Hansen |
last post by:
Hi!
I have a try/catch statement on my webpage, in which a create som html.
Sometimes this routine fails and the catch writes the error in an alert box.
My problem is that the only
thing the...
|
by: aryayudhi |
last post by:
I have a html page that has javascript that works perfectly in IE, but not in Firefox. The use of this javascript to change "Tab" to "Enter" Button. When we press Tab, it is like when we press Enter...
| |
by: stillworkingfortheman |
last post by:
I'm loosing cookies in IE6 (works okay with firefox) with the following
steps...
step 1. set a cookie in one domain, in an .aspx.cs codebehind...
in www.domain.com/subdomain1/page1.aspx...
|
by: alexphd |
last post by:
This code works in firefox perfectly, but in Internet Explorer it does not calculate the total correctly. Anybody know why?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"...
|
by: jnhemley |
last post by:
I have a script that works in Firefox but not IE6-
<script language="JavaScript" type="text/javascript">
document.Params.ThisPageURL.value=document.URL;
var x = new Date ();...
|
by: mike57 |
last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers.
...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
| |
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 ...
| |