pix3l13 | bonjour tout le monde! je n'y connais malheureusement pas assez en JavaScript pour me débrouiller seul donc je viens vous demander de l'aide :$ Voila j'ai trouvé un script de recherche sur internet pour mon site, http://www.pod-online.fr/peint.php Le visiteur insère le code inscrit sur son carnet "92U" (par exemple) et tombe sur le résultat. J'aimerai personnaliser le résultat, mais à part rajouter du texte je n'arrive rien à faire d'autre. Je voudrai mettre un lien et un bouton "imprimer" est-ce possible? Lorsqu'on recherche, il y a un appel du fichier "codepeint.txt" qui contient:
Code :
- var item = new Array();
- // "La page","Son adresse","","Titre de la page","Mot clés","Description de la page"
- c=0; item[c]=new Array("","index.php","Index ","index, home, premiere, page, sommaire","Première page de ce site" );
- c++; item[c]=new Array("","","","full, J3, 60, 25H, 25K","J3/60/25H/25K Ocean jade/Libell tuerkis Metallic" );
- c++; item[c]=new Array("","","","full, Q1","Q1 Pastel Yellow" );
- c++; item[c]=new Array("","","","full, Z1","Z1 Glacier White" );
- c++; item[c]=new Array("","","","full, 12L, 12M","12M/12L Pastellgelb" );
- c++; item[c]=new Array("","","","full, 23F, 22D, 59","22D/23F/59 Slate Gray Metallic" );
- c++; item[c]=new Array("","","","full, 22L, 52","22L/52 Oak Green Metallic" );
- c++; item[c]=new Array("","","","full, 3AE, 39G","3AE/39G Violet Pearl Metallic" );
- c++; item[c]=new Array("","","","full, 3AT, 3AU","3AT/3Au Firnweiss" );
- c++; item[c]=new Array("","","","full, 3AR, 3AS, J1","3AR/3AS/J1 Blue turquoise" );
- c++; item[c]=new Array("","","","full, 3C7, 347, 55","3C7/347/55 Dark Blue" );
- c++; item[c]=new Array("","","","full, 3C8, 37U, 56","3C8/37U/56 Cobalt Blue Metallic" );
- c++; item[c]=new Array("","","","full, 37E, 57","37E/57 Violet Blue Metallic" );
- c++; item[c]=new Array("","","","full, 39C, 37W","39C/37W Night Blue Metallic" );
- c++; item[c]=new Array("","","","full, 39V, 39N","39V/39N Iris Blue Metallic" );
- c++; item[c]=new Array("","","","full, 84R, 84S, H8","84R/84S/H8 Arena Red Metallic" );
- c++; item[c]=new Array("","","","full, 92E, 92M, A8, 58","92E/92M/A8/58 Polar Silver Metallic" );
- c++; item[c]=new Array("","","","full, 92T, 92U","92T/92U Artic Silver Pearl Metallic" );
- c++; item[c]=new Array("","","","full, 554, 555","554/554 Paladio Pearl metallic" );
- c++; item[c]=new Array("","","","full, L041, L747, L741, A1","L041/L0747/L0741/A1 Black" );
- c++; item[c]=new Array("","","","full, L1A8, L1A9","L1A8/L1A9 Orange Red Effect" );
- c++; item[c]=new Array("","","","full, L1A9, L1A8","L1A8/L1A9 Orange Red Pearl Metallic (2001-2002)" );
- c++; item[c]=new Array("","","","full, L12H, L12G, 12H, 12G, 13G, X4, 50","L12H/L12G/12H/12G/13G/X4/50 Speed Yellow" );
- c++; item[c]=new Array("","","","full, L22G","L22G Racing Green Effect" );
- c++; item[c]=new Array("","","","full, L22D, L23F","L22D/L23F Slate Gray Schiefer Pearl metallic " );
- c++; item[c]=new Array("","","","full, L23F","L23F Slate Grey Effect" );
- c++; item[c]=new Array("","","","full, L2A2, L2A1","L2A2/L2A1 Jungle Green Pearl Metallic (2002)" );
- c++; item[c]=new Array("","","","full, L2A2, L2A2","L2A1/L2A2 Dschungel Green Metallic (2001)" );
- c++; item[c]=new Array("","","","full, 2B4, 22E, 53","2B4/22E/53 Forest Green Metallic" );
- c++; item[c]=new Array("","","","full, 2B6, 23I, 51","2B6/23I/51 Wimbleddon Green Metallic" );
- c++; item[c]=new Array("","","","full, L2B4","L2B4 Forest Green Effect (à partir de 2007)" );
- c++; item[c]=new Array("","","","full, L2B4","L2B4 Tannen Green Effect (Avant 2007)" );
- c++; item[c]=new Array("","","","full, L2B5","L2B5 Malachite Green Effect" );
- c++; item[c]=new Array("","","","full, L2D8","L2D8 Green" );
- c++; item[c]=new Array("","","","full, L3A8, L3A9","L3A8/L3A9 Lapis Blue Effect" );
- c++; item[c]=new Array("","","","full, L3A8, L3A9","L3A8/L3A9 Lapis Blue Pearl Metallic (2001-2002)" );
- c++; item[c]=new Array("","","","full, L3AY, L3AZ, 3AY, 3AZ","L3AY/L3AZ/3AY/3AZ Ocean Blue Pearl Metallic" );
- c++; item[c]=new Array("","","","full, L3AW, F1, 3AW","L3AW/F1/3AW Zenith Blue pearl metallic" );
- c++; item[c]=new Array("","","","full, L32B","L32B Segel Blue Effect" );
- c++; item[c]=new Array("","","","full, L39C","L39C Night Blue Effect" );
- c++; item[c]=new Array("","","","full, L3C8","L3C8 Cobalt Blue Effect" );
- c++; item[c]=new Array("","","","full, L40W, L40X, 40w, 40X","L40W/L40X/40W/40X Vesuvio Pearl Metallic" );
- c++; item[c]=new Array("","","","full, L554, 555","L554/555 Paladio Pearl Metallic" );
- c++; item[c]=new Array("","","","full, L51A","L51A Cream White" );
- c++; item[c]=new Array("","","","full, L6A6, L6A7","L6A6/L6A7 Meridian Effect" );
- c++; item[c]=new Array("","","","full, L6A7, L6A6","L6A6/L6A7 Meridian Pearl Metallic (2001-2002)" );
- c++; item[c]=new Array("","","","full, L6B4, L6B5","L6B4/L6B5 Hellgrau Effect (pearl mettalic pour version 2001-2002)" );
- c++; item[c]=new Array("","","","full, L746, L744, 746, 744, Z8","L744/L746/746/744/Z8 Black Pearl Metallic" );
- c++; item[c]=new Array("","","","full, L84A","L84A Indian Red" );
- c++; item[c]=new Array("","","","full, L8A4","L8A3 Orient Red Pearl Metallic" );
- c++; item[c]=new Array("","","","full, L8A7","L8A7 Rubin Red Effect" );
- c++; item[c]=new Array("","","","full, L8C6","L8C6 Orange" );
- c++; item[c]=new Array("","","","full, L80K, L84A, LM3A, G1, G28, 25, 027","L80K/L84A/LM3A/G1/G28/25/027 Guards Red" );
- c++; item[c]=new Array("","","","full, LM3A","LM3A Guards Red" );
- c++; item[c]=new Array("","","","full, L9A3, L9A2","L9A2/L9A3 Biarritz Weis" );
- c++; item[c]=new Array("","","","full, L92M","L92M Polar Silver Effect" );
- c++; item[c]=new Array("","","","full, L92T","L92T Artic Silver Effect" );
- c++; item[c]=new Array("","","","full, L92U","L92U Artic Silver Effect" );
- c++; item[c]=new Array("","","","full, L92T, L92U, X1","L92T/L92u/X1 Artic Silver Pearl Metallic (2000)" );
- c++; item[c]=new Array("","","","full, LB9A","LB9A Carrara White" );
- c++; item[c]=new Array("","","","full, LC9Z","LC9Z Basalt Black Effect (Pearl Metallic pour 2002)" );
- c++; item[c]=new Array("","","","full, LM2Z","LM2Z Nordic gold Effect" );
- c++; item[c]=new Array("","","","full, LM3W","LM3W Cordoba Red Effect" );
- c++; item[c]=new Array("","","","full, LM5W","LM5W Lapis Blue Effect" );
- c++; item[c]=new Array("","","","full, LM6U","LM6U Olive Green Effect" );
- c++; item[c]=new Array("","","","full, LM6W","LM6W Jade Green Effect" );
- c++; item[c]=new Array("","","","full, LM6W","LM6W Lago Green Effect (avant 2007)" );
- c++; item[c]=new Array("","","","full, LM6X","LM6X Dunkel Olive Green Effect" );
- c++; item[c]=new Array("","","","full, LM7W","LM7W Meteor Grey Effect" );
- c++; item[c]=new Array("","","","full, LM7X","LM7X Atlas Grey Effect" );
- c++; item[c]=new Array("","","","full, LM7Z","LM7Z Silverstone Effect" );
- c++; item[c]=new Array("","","","full, LM8W","LM8W Macadamia Effect" );
- c++; item[c]=new Array("","","","full, LY5Z, E1","LY5Z/E1 Ocean Blue Metallic" );
- c++; item[c]=new Array("","","","full, ","" );
- c++; item[c]=new Array("","","","full, ","" );
- page="<html><head><title>Résultats de la recherche</title></head><body bgcolor='#EFEFEF'><center><table border=0 cellspacing=10 width=80%><b>Vos codes peinture!</b>";
- function search(frm) {
- win=window.open("","" );
- win.document.write(page);
- txt = frm.srchval.value.split(" " );
- fnd = new Array(); total=0;
- for (i = 0; i < item.length; i++) {
- fnd[i] = 0; order = new Array(0, 4, 2, 3);
- for (j = 0; j < order.length; j++)
- for (k = 0; k < txt.length; k++)
- if (item[i][order[j]].toLowerCase().toUpperCase().indexOf(txt[k]) > -1 && txt[k] != "" )
- fnd[i] += (j+1);
- }
- for (i = 0; i < fnd.length; i++) {
- n = 0; w = -1;
- for (j = 0;j < fnd.length; j++)
- if (fnd[j] > n) { n = fnd[j]; w = j; };
- if (w > -1) total += show(w, win, n);
- fnd[w] = 0;
- }
- win.document.write("</table><br>code décodé(s): "+total+"<br><p>Pix3L</p></body></html>" );
- win.document.close();
- }
- function show(which,wind,link) {
- link = item[which][1] + item[which][0];
- line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> "+link+"<br>";
- line += item[which][4] + "<br>"+link+"</td></tr>";
- wind.document.write(line);
- return 1;
- }
| ou alors ouvrir le resultat dans une frame? Message édité par pix3l13 le 24-06-2013 à 18:36:16
|