Jump to content

etsted

Members
  • Posts

    274
  • Joined

  • Last visited

Everything posted by etsted

  1. i checked it, and those two are the errors
  2. maybe it goes directly to the url defined in the action attribute
  3. etsted

    Weebly

    lol i didnt notice that you had posted the same as me
  4. etsted

    Weebly

    If you give body a background color in external stylesheetbody {background-color: red;}There is nothing there that will make it target a specific page.If you a apply id ref OR class to body element you can uniquely target that page, for example using a id ref.Page1<body id="bg-color01">Page2<body id="bg-color02">Page3<body id="bg-color03">Then target those id ref to apply different color to those specific pages,#bg-color01 {background-color: red;}#bg-color02 {background-color: green;}#bg-color03 {background-color: yellow;}IF you are able to insert style element within the <head>...</head> of each individual page, then you could just usePage1<style>body {background-color: red;}</style>Page2<style>body {background-color: green;}</style>Page3<style>body {background-color: yellow;}</style>But i suspect it might be template system where you will add this specific style and it will be applied to all.
  5. how can i do that? i wonder so badly

  6. rerewqrewqrewqfddfsvvccvx

  7. saddasdsadsadsa

  8. then use a for loop to loop trough the properties. Store the values in a variable then place the variable where u want it
  9. you are using concatenation here content.innerHTML += propiedades + ':' + objeto[propiedades] + "<br />"; change it to: content.innerHTML = propiedades + ':' + objeto[propiedades] + "<br />";
  10. maybe echo"<script>alert('Timeout!');</script>"; was interpreted as a string instead of javascript
  11. yes that is right. You can get a clear demonstration at my website widegrass.com. Search for "n" using my search bar, then add more "n" and see what happen
  12. when i console.log the str variable it says "No suggestions", but when i try to use that statement in a if statement it doesnt work. var suggested_titels = ajax.responseText.split("S_E_C_R_E_T__S_I_G_N__!_|_!_|"); for(var i =0;i < suggested_titels.length; i++){ var space = document.createElement("BR"); var node = document.createElement("SPAN"); var textnode=document.createTextNode(suggested_titels[i]); var check = document.createTextNode(suggested_titels[0]); var str = document.createElement("DIV"); str.appendChild(check); node.appendChild(textnode); node.appendChild(space); sQ.appendChild(node); if(suggested_titels[0] == "No suggestions"){ sQ.innerHTML = ""; } } console.log(str); sQ is supposed to get empty when there is not suggestions in the DB
  13. i want sQ to empty when the response from ajax.responseText returns No suggestions, but instead it keeps the content of the div and append No suggestions at the end of the div
  14. var sQ = document.getElementById("suggest_query");var suggested_titels = ajax.responseText.split("S_E_C_R_E_T__S_I_G_N__!_|_!_|"); for(var i =0;i < suggested_titels.length; i++){ var space = document.createElement("BR"); var node = document.createElement("SPAN"); var textnode=document.createTextNode(suggested_titels[i]); node.appendChild(textnode); node.appendChild(space); sQ.appendChild(node); if(suggested_titels[i] == "No suggestions"){ sQ.innerHTML = ""; } It seem to be working, but from my code you can see that i want to empty the div when the request equal "No suggestions", but instead it appends "No suggestions" at the back of my div, so it will contain all of the suggested terms and "No suggestions" at the end
  15. i dont know why but it stopped working, then when i console.log it i get this: GET http://widegrass.com/suggested_query.php?q=N&type=images 500 (Internal Server Error) . What does that mean?
  16. go to my website widegrass.com and search "n"
  17. when i search for something there is always a <br> tag infront of the search term, other than that it works for(var i =0;i < suggested_titels.length; i++){ //nr1 += "<span onmouseover='pick_this(this.value)'>"+ suggested_titels[i] +"</span>"; var space = document.createElement("BR"); var node = document.createElement("SPAN"); var textnode=document.createTextNode(suggested_titels[i]); node.appendChild(textnode); node.appendChild(space); document.getElementById("suggested_query").appendChild(node); }
  18. well i tried this code, but it only renders a <br>. and the console.log shows <span>_</span> var space = document.createElement("BR"); var textnode = ""; for(var i =0;i < suggested_titels.length; i++){ //nr1 += "<span onmouseover='pick_this(this.value)'>"+ suggested_titels[i] +"</span>"; var node = document.createElement("SPAN"); var textnode=document.createTextNode(suggested_titels[i]); node.appendChild(textnode); node.appendChild(space); } document.getElementById("suggested_query").appendChild(node); console.log(node);
  19. i tried this, didnt quite work var nr1 = ""; var node = document.createElement("SPAN"); var textnode = ""; for(var i =0;i < suggested_titels.length; i++){ //nr1 += "<span onmouseover='pick_this(this.value)'>"+ suggested_titels[i] +"</span>"; textnode=document.createTextNode(""+suggested_titels[i]+""); node.appendChild(textnode); } document.getElementById("suggested_query").appendChild(node); console.log(node); the console.log logs <span> <br></span>. While inside suggested_query i get all search result as one big span, and the <br> are visible
  20. i get Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node': The new child element is null. When trying to use appendChild, but if i try innerHTML it works. var suggested_titels = ajax.responseText.split("S_E_C_R_E_T__S_I_G_N__!_|_!_|"); var nr1 = ""; for(var i =0;i < suggested_titels.length; i++){ nr1 += "<span onmouseover='pick_this(this.value)'>"+ suggested_titels[i] +"</span>"; } document.getElementById("suggested_query").appendChild(nr1); console.log(nr1); }
  21. if i were to take away that for loop and write something like this: document.getElementById("suggested_query").innerHTML = suggested_titels[0], then it works. Btw the showMore is called further down; Search: <input type="text" name="s" size='70' id='search' onkeyup="showMore(this.value)" autocomplete="off" value="<?php if(isset($_GET['s'])){echo trim($_GET['s']);}?>"> Inside a form and under the form is this: <div id="suggested_query"></div>
  22. when i try to run this code console.log says showMore is not defined function showMore(str){var sQ = document.getElementById("suggested_query"); var type = document.getElementById("mySelect").value; if (str.length==0) { sQ.style.height = "0px"; sQ.innerHTML=""; return; } var ajax = ajaxObj("GET", "suggested_query.php?q="+str+"&type="+type); ajax.onreadystatechange = function() { if(ajaxReturn(ajax) == true) { sQ.style.height = "145px"; var suggested_titels = ajax.responseText.split("S_E_C_R_E_T__S_I_G_N__!_|_!_|"); var nr1 = ""; for(var i =0;i < suggested_titels.length; i++){ nr1 .= "<span>"+ suggested_titels[i] +"</span>"; } } } ajax.send();}
×
×
  • Create New...