quote:Op vrijdag 6 maart 2009 18:48 schreef Roy_T het volgende:
Haal je HTML door de validator, en je zult zien waarom het niet werkt (hint: een id moet uniek zijn).
Ik zou de HTML goed opzetten (dus met een unordered list), en de kleur switchen d.m.v. het aanpassen van de class van de UL (en zo voor alle kind LI's de bullet aanpassen).
Deze OP: http://wiki.fok.nl/index.php/OP/Javascriptquote:Op zaterdag 7 maart 2009 12:29 schreef poepeneesje het volgende:
Vraagje, ik wil graag in de onderstaande code myDiv verwijderen i.p.v. removable. Hoe realiseer ik dat?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21<html>
<head>
<script type="text/javascript">
function removeEvent(divNum){
var d = document.getElementById('myDiv');
var olddiv = document.getElementById(divNum);
d.removeChild(olddiv);
return false;
}
</script>
</head>
<body>
<div id="myDiv">
<div id="removable">
<a href="#" onclick="removeEvent('removable');">REMOVE ME</a>
</div>
</div>
</body>
</html>
Misschien weet jij het antwoord op mijn vraag (gequote in de OP).quote:
1 2 3 4 5 | { var el = document.getElementById(id); el.parentNode.removeChild(el); } |
1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link href="css.css" rel="stylesheet" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>BlAaTz0r</title> <link href="css/css.css" rel="stylesheet" type="text/css" /> </head> <body> <div ALIGN="center" id="header"><img src="images/coming-soon.png" /> </div> </body> </html> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /* CSS Document */ body { background-repeat: no-repeat; background-color: #000000; margin: 0px; font-family: Tahoma, serif; font-size: 11px; color: #ffffff; } #header { margin-top: 40px; } |
1 2 3 4 5 6 7 8 9 10 | <!-- document.write("<table width='500' height='300' border='0' cellspacing='0' cellpadding='1' style='display:none;position:absolute;top:10px;left:10px;empty-cells:hide' id='v1771235936960217v181'>") ;document.write("<tr><td style='background: #062F91'>");document.write("<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'>");document.write("<tr height='0'><td>") ;document.write("<table width='100%' border='0' cellspacing='1' cellpadding='0' style='background: #FFFFFF; color: #062F91; cursor: default'><tr style='font-family: Arial, sans-serif; font-size: 10pt; font-weight: bold'><td>.") ;document.write("<td style='width: 20px; cursor: pointer;' onclick='java script:v1771235936960217v184();'>X");document.write("</table>");document.write("<tr><td>"); ;document.write("<table width='100%' height='100%' id='v1771235936960217v185' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'>");document.write("<tr>");document.write("<td>") ;document.write("<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\"><tr><td><font face=\"Verdana\" size=\"2\"><img border=\"0\" src=\"Floater.jpg\"><br> </td></tr></table>");document.write("</table></table></table>"); if ( document.getElementById ) v1771235936960217v186 = document.getElementById ( "v1771235936960217v181" ); else v1771235936960217v186 = document.all ["v1771235936960217v181"]; var v1771235936960217v188 = false; function v1771235936960217v183 ( ) { if ( document.getElementById ) v189 = document.getElementById ( "v1771235936960217v185" ); else v189 = document.all ["v1771235936960217v185"]; if ( v189.style.display == "none" ) { v189.style.display = ""; v1771235936960217v186.style.height = "300px"; } else { v189.style.display = "none"; v1771235936960217v186.style.height = "20px"; } } function v1771235936960217v184 ( ) { v1771235936960217v186.style.display = "none"; v1771235936960217v188 = true; } var v1771235936960217v175, v1771235936960217v176; var v1771235936960217v190, v1771235936960217v191; function v1771235936960217v192 ( ) { return ( ( window.pageXOffset ) ? window.pageXOffset : document.body.scrollLeft ) + v1771235936960217v190; } function v1771235936960217v193 ( ) { return ( ( window.pageYOffset ) ? window.pageYOffset : document.body.scrollTop ) + v1771235936960217v191; } function v1771235936960217v194 ( ) { var v195 = 500; v1771235936960217v186.style.top = v1771235936960217v193 ( ); v1771235936960217v186.style.left = v1771235936960217v192 ( ); if ( ( v1771235936960217v187 -= v195 ) <= 0 ) v1771235936960217v196 ( ); else setTimeout ( "v1771235936960217v194 ( );", v195 ); } function v1771235936960217v197 ( v198 ) { if ( v1771235936960217v190 != v1771235936960217v175 || v1771235936960217v191 != v1771235936960217v176 ) { if ( v1771235936960217v190 != v1771235936960217v175 ) if ( Math.abs ( v1771235936960217v190 - v1771235936960217v175 ) <= v1771235936960217v199 ) v1771235936960217v190 = v1771235936960217v175; else if ( v1771235936960217v190 < v1771235936960217v175 ) v1771235936960217v190 += v1771235936960217v199; else v1771235936960217v190 -= v1771235936960217v199; if ( v1771235936960217v191 != v1771235936960217v176 ) if ( Math.abs ( v1771235936960217v191 - v1771235936960217v176 ) <= v1771235936960217v199 ) v1771235936960217v191 = v1771235936960217v176; else if ( v1771235936960217v191 < v1771235936960217v176 ) v1771235936960217v191 += v1771235936960217v199; else v1771235936960217v191 -= v1771235936960217v199; v1771235936960217v186.style.top = v1771235936960217v193 ( ); v1771235936960217v186.style.left = v1771235936960217v192 ( ); setTimeout ( "v1771235936960217v197 ( " + v198 + " );", 20 ); } else if ( v198 ) v1771235936960217v194 ( ); else v1771235936960217v186.style.display = "none"; } function v1771235936960217v200 ( v201, v202 ) { v1771235936960217v175 = v201; v1771235936960217v176 = v202; v1771235936960217v190 = v201; v1771235936960217v191 = v202; var v205 = 0, v206 = 0; v205 = -v201 -500; v206 = -v202 -300; if ( v205 != 0 && v206 != 0 ) if ( Math.abs ( v205 ) < Math.abs ( v206 ) ) v206 = v206 / Math.abs ( v206 ) * Math.abs ( v205 ); else v205 = v205 / Math.abs ( v205 ) * Math.abs ( v206 ); v1771235936960217v190 += v205; v1771235936960217v191 += v206; v1771235936960217v186.style.top = v1771235936960217v193 ( ); v1771235936960217v186.style.left = v1771235936960217v192 ( ); v1771235936960217v186.style.display = ""; v1771235936960217v197 ( true ); } function v1771235936960217v196 ( ) { if ( v1771235936960217v188 ) return; v1771235936960217v199 = 24; var v205 = 0, v206 = 0; var v201 = v1771235936960217v175, v202 = v1771235936960217v176; v205 = ( ( window.innerWidth ) ? window.innerWidth : document.body.clientWidth ) - v201; if ( v205 != 0 && v206 != 0 ) if ( Math.abs ( v205 ) < Math.abs ( v206 ) ) v206 = v206 / Math.abs ( v206 ) * Math.abs ( v205 ); else v205 = v205 / Math.abs ( v205 ) * Math.abs ( v206 ); v1771235936960217v175 += v205; v1771235936960217v176 += v206; v1771235936960217v186.style.top = v1771235936960217v193 ( ); v1771235936960217v186.style.left = v1771235936960217v192 ( ); v1771235936960217v186.style.display = ""; v1771235936960217v197 ( false ); } var v1771235936960217v199 = 16.970725498515062; setTimeout ( "v1771235936960217v200 ( 400, 100, 16.970725498515062 );", 1500 ); var v1771235936960217v217, v1771235936960217v218; function v1771235936960217v219 ( v220 ) { v221 = ( document.all ) ? event.clientX : v220.clientX; v222 = ( document.all ) ? event.clientY : v220.clientY; v1771235936960217v190 += v221 - v1771235936960217v217; v1771235936960217v191 += v222 - v1771235936960217v218; v1771235936960217v217 = v221; v1771235936960217v218 = v222; v1771235936960217v186.style.top = v1771235936960217v193 ( ); v1771235936960217v186.style.left = v1771235936960217v192 ( ); } function v1771235936960217v223 ( ) { } function v1771235936960217v224 ( ) { document.onmousemove = v1771235936960217v223; document.onmouseup = v1771235936960217v223; } function v1771235936960217v225 ( v220 ) { v1771235936960217v217 = ( document.all ) ? event.clientX : v220.clientX; v1771235936960217v218 = ( document.all ) ? event.clientY : v220.clientY; document.onmousemove = v1771235936960217v219; document.onmouseup = v1771235936960217v224; } v1771235936960217v186.onmousedown = v1771235936960217v225; //--> </SCRIPT> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | function makePOSTRequest(url, parameters) { http_request = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { // set type accordingly to anticipated content type //http_request.overrideMimeType('text/xml'); http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Cannot create XMLHTTP instance'); return false; } http_request.onreadystatechange = alertContents; http_request.open('POST', url, true); http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http_request.setRequestHeader("Content-length", parameters.length); http_request.setRequestHeader("Connection", "close"); http_request.send(parameters); } function alertContents() { if (http_request.readyState == 4) { if (http_request.status == 200) { //alert(http_request.responseText); result = http_request.responseText; document.getElementById('myspan').innerHTML = result; } else { alert('There was a problem with the request.'); } } } function get(obj) { var poststr = "items=" + encodeURI( document.getElementById("items").value ); makePOSTRequest('/index_ajax.php', poststr); } |
PHP is mijn sterkste punt, javascript niet. Zou je een voorbeeld willen geven?quote:Op donderdag 12 maart 2009 21:07 schreef SuperRembo het volgende:
Tja, dit kan je op zo veel manieren oplossen. Gewoon een beetje creatief denken. Je kan in ieder geval door de elements collection van het form heen lopen en dan verzamelen wat je nodig hebt.
1 2 3 4 5 6 7 8 | for (var i = 0; i < elems.length; ++i) { if (ditElementMoetIkHebben(elems[i])) { doeErIetsMee(elems[i]); } } |
quote:Ik krijg de volgende foutmelding:
Beveiligingsfout: inhoud op http://googleads.g.doubleclick.net/ laadt misschien geen gegevens van http://localhost/Bedrijf/2009/*****
met de volgende code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | <form method="get" action="/test.html" onsubmit="return confirm('is dit goed?');"> <div id="mapSrc" style="width: 500px; height: 300px;"></div> <script data-src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjaGYVLt_6aIgQ3_DyJpHgRQDdrEchiyrLmzV4Lyqaurkd2gZnBS6RD4u_vdDterjiHsQrZeNRIEjnA" style="visibility:hidden;" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ var marker = null; var geocoder = null; // window.onunload = GUnload; var map = new GMap2(document.getElementById("mapSrc")); map.setCenter(new GLatLng(52, 5), 10); geocoder = new GClientGeocoder(); GEvent.addListener(map, 'click', function(overlay, point) { clicked(overlay, point) //if (!point) return; if (marker) { // Remove privious marker map.removeOverlay(marker); } // Create new marker var center = new GLatLng(point.y, point.x); marker = new GMarker(center, {draggable: true}); map.addOverlay(marker); } ) ; function clicked(overlay, latlng) { if (latlng) { geocoder.getLocations(latlng, function(addresses) { if(addresses.Status.code != 200) { alert("reverse geocoder failed to find an address for " + latlng.toUrlValue()); } else { address = addresses.Placemark[0]; var myHtml = address.address; map.openInfoWindow(latlng, myHtml); } } </script> Zoek <input type="text" id="address" name="" value="" /> <input type="submit" name="" value="Versturen" /> </form> </div> |
ps googleMaps werkt niet op 127.0.0.30quote:Iemand die deze foutmelding snapt?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | function imgButtonPressed(event){ /// get form /// var curform = event.srcElement; while(curform.tagName != "FORM") { curform = curform.parentNode; } /// create hidden input with values of image submit /// var hid = document.createElement("input"); hid.type = "hidden"; hid.name = event.srcElement.name; hid.value = event.srcElement.value; curform.appendChild(hid) } onload = function() { inputs = document.getElementsByTagName("input"); if (inputs[0].attachEvent) { for (a = 0; a < inputs.length; a++) { if (inputs[a].type == "image") { inputs[a].attachEvent('onclick', imgButtonPressed); } } } } </script> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | $(function() { $("#confirmation").dialog({ bgiframe: true, resizable: false, height:190, width: 350, modal: true, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Bezoeker toch inchecken': function() { $('#CheckInForm').submit(); }, 'Annuleren': function() { $(this).dialog('close'); } } }); }); </script> |
Forum Opties | |
---|---|
Forumhop: | |
Hop naar: |