Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
function getCityList(sel)
{
var eigenschap = sel.options[sel.selectedIndex].value;
document.getElementById('dhtmlgoodies_processor').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajax.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajax.onCompletion = createProcessor; // Specify function that will be executed after file has been found
ajax.runAJAX(); // Execute AJAX function
}
document.getElementById('dhtmlgoodies_geheugen').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajaxTwo.requestFile = 'search.php?type=geheugen&eigenschap='+eigenschap; // Specifying which file to get
ajaxTwo.onCompletion = createGeheugen; // Specify function that will be executed after file has been found
ajaxTwo.runAJAX(); // Execute AJAX function
}
}
include('config.php');
if(isset($_GET['type']) && isset($_GET['eigenschap']])) {
switch($_GET['type']){
case "processor":
$cpuQuery = "SELECT * FROM processors WHERE type='". $_GET['eigenschap'] ."'";
$cpuResult = mysql_query($cpuQuery) or die(mysql_error());
while($cpuRow = mysql_fetch_array($cpuResult)){
echo "obj.options[obj.options.length] = new Option('$cpuRow[naam]','$cpuRow[id]');\n";
}
break;
case "geheugen":
break;
}
}
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Your website</title>
<link rel="stylesheet" href="indexs.css" type="text/css" />
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript">
var ajax = new sack();
var ajaxTwo = new sack();
var ajaxThree = new sack();
function getCityList(sel)
{
var countryCode = sel.options[sel.selectedIndex].value;
document.getElementById('dhtmlgoodies_processor').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajax.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajax.onCompletion = createProcessor; // Specify function that will be executed after file has been found
ajax.runAJAX(); // Execute AJAX function
}
document.getElementById('dhtmlgoodies_geheugen').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajaxTwo.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajaxTwo.onCompletion = createGeheugen; // Specify function that will be executed after file has been found
ajaxTwo.runAJAX(); // Execute AJAX function
}
document.getElementById('dhtmlgoodies_videokaart').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajaxThree.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajaxThree.onCompletion = createVideokaart; // Specify function that will be executed after file has been found
ajaxThree.runAJAX(); // Execute AJAX function
}
}
function createProcessor()
{
var obj = document.getElementById('dhtmlgoodies_processor');
eval(ajax.response); // Executing the response from Ajax as Javascript code
}
function createGeheugen()
{
var obj = document.getElementById('dhtmlgoodies_geheugen');
eval(ajaxTwo.response); // Executing the response from Ajax as Javascript code
}
function createVideokaart()
{
var obj = document.getElementById('dhtmlgoodies_videokaart');
eval(ajaxThree.response); // Executing the response from Ajax as Javascript code
}
</script>
</head>
<body>
<center>
<div id="surround">
<div id="wrap">
<div id="logo"><img src="images/logo.gif" alt="Your website" /></div>
<div id="header"><img src="images/header.jpg" alt="" /></div>
<div id="left">
<img src="images/gradnav.jpg" alt="" />
<div id="nav">
<div class="subnav"><a href="#" class="navlink">Home page</a></div>
<div class="subnav"><a href="#" class="navlink">About Us</a></div>
<div class="subnav"><a href="#" class="navlink">Products and Services</a></div>
<div class="subnav"><a href="#" class="navlink">Customer Services</a></div>
<div class="subnav"><a href="#" class="navlink">F.A.Q.</a></div>
<div class="subnav"><a href="#" class="navlink">Contat us</a></div>
</div>
<div id="news">
<br /><br />
<span id="newsheadline">07-02-05 - News headline</span><br />
<p>
Etiam at quam non enim luctus pharetra. Aenean vel dui. Donec varius hendrerit nunc. Maecenas facilisis libero sit amet arcu. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
</p><br />
</div>
<div id="search">
<form action="#">
<b>Site search</b><br />
<input type="text" name="q" />
<input type="image" name="searchbttn" src="images/search.jpg" /><br /><br />
</form>
</div>
</div>
<div id="main">
<form action="" method="post">
<table>
<tr>
<td>Moederbord:</td>
<td>
<?
include("config.php");
$sql="SELECT * FROM moederbord";
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {
$id=$row["id"];
$type=$row["type"];
$videokaart=$row["videokaart"];
$prijs=$row["prijs"];
$naam=$row["naam"];
$options.="<OPTION VALUE=\"$type\">".$naam. " €".$prijs. '</option>';
}
?>
<SELECT id="dhtmlgoodies_country" name="dhtmlgoodies_country" onchange="getCityList(this)">
<OPTION VALUE=0>Choose
<?=$options?>
</SELECT>
<tr>
<td>Processor: </td>
<td><select id="dhtmlgoodies_processor" name="dhtmlgoodies_processor">
</select>
</td>
</tr>
<tr>
<td>Geheugen: </td>
<td><select id="dhtmlgoodies_geheugen" name="dhtmlgoodies_geheugen">
</select>
</td>
</tr>
<tr>
<td>Videokaart: </td>
<td><select id="dhtmlgoodies_videokaart" name="dhtmlgoodies_videokaart">
</select>
</td>
</tr>
</table>
</form>
<? $kosten = $prijs + 0;
echo'
€'. $kosten .'
';
?>
</div>
<div style="clear:both"></div>
</div>
</div>
<a class="linkback" href="http://www.spykadesign.com">Free Template by Spyka Design</a>
</center>
</body>
</html>
<?
include('config.php');
if(isset($_GET['type']) && isset($_GET['eigenschap']])) {
switch($_GET['type']){
case "processor":
$cpuQuery = "SELECT * FROM processors WHERE type='". $_GET['eigenschap'] ."'";
$cpuResult = mysql_query($cpuQuery) or die(mysql_error());
while($cpuRow = mysql_fetch_array($cpuResult)){
echo "obj.options[obj.options.length] = new Option('$cpuRow[naam]','$cpuRow[id]');\n";
}
break;
case "geheugen":
$geheugenQuery = "SELECT * FROM geheugen WHERE type='". $_GET['eigenschap'] ."'";
$geheugenResult = mysql_query($geheugenQuery) or die(mysql_error());
while($geheugenRow = mysql_fetch_array($geheugenResult)){
echo "obj.options[obj.options.length] = new Option('$geheugenRow[naam]','$geheugenRow[id]');\n";
break;
case "videokaart":
$videokaartQuery = "SELECT * FROM videokaart WHERE type='". $_GET['eigenschap'] ."'";
$videokaartResult = mysql_query($videokaartQuery) or die(mysql_error());
while($videokaartRow = mysql_fetch_array($videokaartResult)){
echo "obj.options[obj.options.length] = new Option('$videokaartRow[naam]','$videokaartRow[id]');\n";
break;
}
}
?>
<script type="text/javascript">
var ajax = new sack();
var ajaxTwo = new sack();
var ajaxThree = new sack();
function getCityList(sel)
{
var countryCode = sel.options[sel.selectedIndex].value;
document.getElementById('dhtmlgoodies_processor').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajax.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajax.onCompletion = createProcessor; // Specify function that will be executed after file has been found
ajax.runAJAX(); // Execute AJAX function
}
document.getElementById('dhtmlgoodies_geheugen').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajaxTwo.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajaxTwo.onCompletion = createGeheugen; // Specify function that will be executed after file has been found
ajaxTwo.runAJAX(); // Execute AJAX function
}
document.getElementById('dhtmlgoodies_videokaart').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajaxThree.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajaxThree.onCompletion = createVideokaart; // Specify function that will be executed after file has been found
ajaxThree.runAJAX(); // Execute AJAX function
}
}
function createProcessor()
{
var obj = document.getElementById('dhtmlgoodies_processor');
eval(ajax.response); // Executing the response from Ajax as Javascript code
}
function createGeheugen()
{
var obj = document.getElementById('dhtmlgoodies_geheugen');
eval(ajaxTwo.response); // Executing the response from Ajax as Javascript code
}
function createVideokaart()
{
var obj = document.getElementById('dhtmlgoodies_videokaart');
eval(ajaxThree.response); // Executing the response from Ajax as Javascript code
}
</script>
Parse error: syntax error, unexpected ']', expecting ',' or ')' in C:\Xampp\htdocs\sell\search.php on line 4
Parse error: syntax error, unexpected T_CASE in C:\Xampp\htdocs\sell\search.php on line 19
var countryCode = sel.options[sel.selectedIndex].value;
document.getElementById('dhtmlgoodies_processor').options.length = 0; // Empty city select box
if(countryCode.length>0){
ajax.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajax.onCompletion = createProcessor; // Specify function that will be executed after file has been found
ajax.runAJAX(); // Execute AJAX function
<SELECT id="dhtmlgoodies_country" name="dhtmlgoodies_country" onchange="getCityList(this)">
if(countryCode.length>0){
$options.="<OPTION VALUE=\"$type\">".$naam. " €".$prijs. '</option>';
function getCityList(sel)
{
var eigenschap = sel.options[sel.selectedIndex].value;
document.getElementById('dhtmlgoodies_processor').options.length = 0; // Empty city select box
if(eigenschap.length>0){
ajax.requestFile = 'search.php?type=processor&eigenschap='+eigenschap; // Specifying which file to get
ajax.onCompletion = createProcessor; // Specify function that will be executed after file has been found
ajax.runAJAX(); // Execute AJAX function
ajaxTwo.requestFile = 'search.php?type=geheugen&eigenschap='+eigenschap; // Specifying which file to get
ajaxTwo.onCompletion = createGeheugen; // Specify function that will be executed after file has been found
ajaxTwo.runAJAX(); // Execute AJAX function
ajaxThree.requestFile = 'search.php?type=videokaart&eigenschap='+eigenschap; // Specifying which file to get
ajaxThree.onCompletion = createVideokaart; // Specify function that will be executed after file has been found
ajaxThree.runAJAX(); // Execute AJAX function
}
}
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.