Search Results

Search found 29484 results on 1180 pages for 'html'.

Page 39/1180 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • HTML relative links with URL Rewrite

    - by Adam Kiss
    I have quickie: When you code/develop themes, how do you link to various files in your html/css code? Example: We at our firm use mostly <base target="http://whatever"> in our main template and then just <img src="./images/file.png"> in our html, "/category/page" as links and something alike in our css. However, when testing on different machines, we use ip address rather than localhost on main dev station of coder, so all base links don't work (because localhost goes to viewing machine, not coder's, in our network). Same thing happens when updating pages - on dev server, we have to edit base target, so browsing site won't take us to live site - this part is actually rather simple PHP (if ... echo else echo something else), but it still not solve problem of more coding-testing problems. So, my question is, how do YOU solve it? How do you use relative links, which basically don't care for what domain is the page on and don't care for url rewrite? (because ../images/ is different for / and different for /something/somethingElse/page)?

    Read the article

  • javascript check function for a html form

    - by Reteras Remus
    I'm having a problem with a HTML form (name, e-mail, subject, message), I can't validate the form if it was completed correct or not. I want to call a javascript function when the form is submitted and alert if a field wasn't completed correct. My problem is with the submit button, because my boss said that I must use he's own php function to insert a submit button. The php function looke like: function normal_button($text, $width, $param = '', $class = 'button-blue') { $content = '<div class="'.$class.'" style="width:'.$width.'px;" '.$param.'>'.$text.'</div>'; return $content; } and how I call the function: echo normal_button('Send it', '100', 'onclick="document.getElementById(\'emailForm\').submit();" '); I tried to call the js function declaring the onSubmit="return checkForm(this)" in the <form action='email.php' method='post'> HTML form, but I can't "catch" the submit. Also I tried to catch it with jquery, $(document).ready(function() { $('.normal_button').click(function() { }); ); but I can't return false if a field wasn't completed correct. I must use he's PHP function to insert the submit button, but how can I "catch" the fields, how can I validate them? Any suggestions? Thank you !

    Read the article

  • HTML relative links on various domains

    - by Adam Kiss
    I have quickie: When you code/develop themes, how do you link to various files in your html/css code? Example: We at our firm use mostly <base target="http://whatever"> in our main template and then just <img src="./images/file.png"> in our html, "/category/page" as links and something alike in our css. However, when testing on different machines, we use ip address rather than localhost on main dev station of coder, so all base links don't work (because localhost goes to viewing machine, not coder's, in our network). Same thing happens when updating pages - on dev server, we have to edit base target, so browsing site won't take us to live site - this part is actually rather simple PHP (if ... echo else echo something else), but it still not solve problem of more coding-testing problems. So, my question is, how do YOU solve it? How do you use relative links, which basically don't care for what domain is the page on and don't care for url rewrite? (because ../images/ is different for / and different for /something/somethingElse/page)?

    Read the article

  • HTML dynamic tags insert looks different compared to static layout

    - by Andrew Florko
    I program HTML interface with jquery. There is editable list of publications on the page and user can click any publication to edit details. Popup window appears with data and there is list of authors embedded into details form. There are edit/delete buttons against every of them + "add new author" button. User manipulates authors without page reload. When I insert a new author there are new edit/delete buttons created dynamically & embedded into page. I insert tags like this: <td class="author-actions"> <img onclick='edit(id)' .../> <img onclick='delete(id)' .../> </td> Just the same html-layout that is sent from web-server when popup window appears. But somehow it looks different. There is extraspace between images though firebug demonstrates the same css attributes applied. If I select with mouse inserted layout with IE, somehow it can reorder and become the same-looklike as the those, send by web-server. What can it be?

    Read the article

  • What is the purpose of the Html "no-js" class?

    - by Swader
    I notice that in a lot of template engines, in the HTML5 Boilerplate, in various frameworks and in plain php sites there is the no-js class added onto the html element. Why is this done? Is there some sort of default browser behavior that reacts to this class? Why include it always? Does that not render the class itself obsolete, if there is no no-"no-js" case and html can be addressed directly? Here is an example from the HTML5 Boilerplate index.html: <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]--> As you can see, the html element will always have this class. Can someone explain why this is done so often?

    Read the article

  • java: how to parse html-like xml

    - by Yang
    I have an html-like xml, basically it is html. I need to get the elements in each . Each element looks like this: <line tid="744476117"> <attr>1414</attr> <attr>31</attr><attr class="thread_title">title1</attr><attr>author1</attr><attr>date1</attr></line> My code is as below, it does recognize that there are 50 in the file, but it gives me NULLPointException when parsing NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("attr"); Any idea why this is happening? The same code has been used for other applications without problems. DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); is.setCharacterStream(new StringReader(cleanxml)); Document doc = db.parse(is); doc.getDocumentElement().normalize(); System.out.println("Root element " + doc.getDocumentElement().getNodeName()); NodeList nodeLst = doc.getElementsByTagName("line"); for (int s = 0; s < nodeLst.getLength(); s++) { System.out.println(nodeLst.getLength()); Node fstNode = nodeLst.item(s); if (fstNode.getNodeType() == Node.ELEMENT_NODE) { Element fstElmnt = (Element) fstNode; NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("attr"); Element fstNmElmnt = (Element) fstNmElmntLst.item(0); NodeList fstNm = fstNmElmnt.getChildNodes(); System.out.println("attr : " + ((Node) fstNm.item(0)).getNodeValue()); } }

    Read the article

  • HTML table cells not properly aligned

    - by Yuval A
    I have the following HTML table: <table style="width: 100%;"> <tr> <td class="title_bar_left_border"></td> <td class="title_bar_middle"></td> <td class="title_bar_right_border"></td> </tr> </table> With the following css rules: .title_bar_left_border { BACKGROUND-IMAGE: url(tray_left.gif); WIDTH: 3px; HEIGHT: 24px; } .title_bar_right_border { BACKGROUND-IMAGE: url(tray_right.gif); WIDTH: 3px; HEIGHT: 24px; } .title_bar_middle { BACKGROUND-IMAGE: url(tray_middle.gif); WIDTH: 100%; BACKGROUND-REPEAT: repeat-x; HEIGHT: 24px; } Any idea why this is the result? Instead of getting a nice table header with rounded corners you get this weird gap between the cells. Where are the gaps coming from? Besides fixing this ugly issue, I would like to understand the rationale as to why all browsers render the HTML this way.

    Read the article

  • Conflict with @Html.LabelFor and W3C Validator?

    - by Tyler
    I have a model that I am using to present an index of a model from a database and have given a display name to some of the rows that may need spaces in them, (I.e. "weekstarting" in a db would be given a display name of "Week Starting"). So I set the display name for my model like this: [DisplayName("Week Starting")] public DateTime WeekStarting { get; set; } and then in the table headers for my table I use the following line of code to display the field name using its given display name: @Html.LabelFor(x => x.First().WeekStarting) The above all works fine. But I am using the W3C validator and it is giving me the following error for the example I have given: The for attribute of the label element must refer to a form control. Forgive me if it is obvious but what am I doing wrong here? I am not using a form I am simply displaying an index of items in a table. I have tried to look for an answer and saw someone suggest that the form controls being referred to need ids (even though I'm not using a form) but this would not be applicable in this instance because if I tried to set an id in the index it would be duplicated with each item in the index: foreach (var item in Model.Tbms) { <tr><td>@item.value</td><tr>.... would be repeated for each item, and also unsure where I would put the id in any case, the td? } Or is there a better way to label the field header, with my preferred display name in the first place? I guess I could just swap @Html.LabelFor... for Hard code field name but do I have to?

    Read the article

  • client-side data storage and retrieval with html and javascript

    - by pedalpete
    I'm building what I am hoping to be a fairly simple, quick and dirty demo app. So far, I've managed to build a bunch of components using only html and javascript. I know that eventually I'll hook-up a db, but at this point I'm just trying to show off some functionality. In the page, a user can select a bunch of other users (like friends). Then they go to a separate html page and there is some sorting info based on the selected users. So my first attempt was to put the selected users object into a cookie, and retrieve the cookie on the second page. Unfortunately, if the user changed their selection, the cookie wasn't getting updated, and my searches on StackOverflow seemed to say that deleting and updating cookies is unreliable. I tried function updateCookie(updatedUserList){ jQuery.cookie('userList',null); jQuery.cookie('userList',updatedUserList); } but though it set the cookie to null, it wouldn't update it on the second value. So I decided to put the selected users object into a form. Unfortunately, it looks like I can't retrieve the contents from the form on the client-side, only on the server-side. Is there another way to do this? I've worked in PHP and Rails, but I'm trying to do this quickly and simply before building it out into something larger and am trying to avoid any server-side processing for now, which I have managed to do up to this point.

    Read the article

  • Xml output on HTML

    - by umitunal
    Hi, My xml data = &lt;Item "/api/items/4000000002011"&gt;&lt;ItemID&gt;4000000002011&lt;/ItemID&gt;&lt;Name&gt;Sample Item1&lt;/Name&gt;&lt;Description&gt;Sample Description&lt;/Description&gt;&lt;Rate&gt;34.00&lt;/Rate&gt;&lt;Tax1Name&gt;PST&lt;/Tax1Name&gt;&lt;Tax1Percentage&gt;8&lt;/Tax1Percentage&gt;&lt;Tax2Name/&gt;&lt;Tax2Percentage/&gt;&lt;/Item&gt; Html output=<Item uri="/api/items/4000000002011"> <ItemID>4000000002011</ItemID><Name>Sample Item1</Name><Description>Sample Description</Description><Rate>34.00</Rate><Tax1Name>PST</Tax1Name><Tax1Percentage>8</Tax1Percentage><Tax2Name/><Tax2Percentage/></Item> I want to html output.How do I? <Item "/api/items/4000000002011"> <ItemID>4000000002011</ItemID> <Name>Sample Item1</Name> <Description>Sample Description</Description> <Rate>34.00</Rate> <Tax1Name>PST</Tax1Name> <Tax1Percentage>8</Tax1Percentage> <Tax2Name/> <Tax2Percentage/> </Item>

    Read the article

  • Android: Having trouble getting html from webpage

    - by Kyle
    Hi, I'm writing an android application that is supposed to get the html from a php page and use the parsed data from thepage. I've searched for this issue on here, and ended up using some code from an example another poster put up. Here is my code so far: HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(url); try { Log.d("first","first"); HttpResponse response = client.execute(request); String html = ""; Log.d("second","second"); InputStream in = response.getEntity().getContent(); Log.d("third","third"); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); Log.d("fourth","fourth"); StringBuilder str = new StringBuilder(); String line = null; Log.d("fifth","fifth"); while((line = reader.readLine()) != null) { Log.d("request line",line); } in.close(); } catch (ClientProtocolException e) { } catch (IOException e) { // TODO Auto-generated catch block Log.d("error", "error"); } Log.d("end","end"); } Like I said before, the url is a php page. Whenever I run this code, it prints out the first first message, but then prints out the error error message and then finally the end end message. I've tried modifying the headers, but I've had no luck with it. Any help would be greatly appreciated as I don't know what I'm doing wrong. Thanks!

    Read the article

  • How do I post back information from a webpage that has post-generated content?

    - by meanbunny
    Ok so I am very new to html and the web. Right now I am trying to generate list items on the fly and then have them post back to the web server so I know what the person is trying to obtain. Here is the code for generating the list items: foreach (var item in dataList) { MyDataList.InnerHtml += "<li><a runat='server' onclick='li_Click' id='" + item.Name + "-button'></a></li>"; } Further down I have my click event. protected void li_Click(object sender, EventArgs e) { //How do I determine here which item was actually clicked? } My question is how do I determine which list item was clicked? Btw, the code running behind is C#. EDIT 1 LinkButton link = new LinkButton(); link.ID = "all-button"; link.Text = "All"; link.Click += new EventHandler(link_Click); MyDataList.Controls.Add(link); Then below I have my link_Click event that never seems to hit a breakpoint. void link_Click(object sender, EventArgs e) { if (sender != null) { if (sender.GetType() == typeof(LinkButton)) { LinkButton button = (LinkButton)sender; if (button.ID == "all-button") { } } } } I know this has to be possible I just cant figure out what I am missing. Edit 2 Ok ok I think I know what the problem is. I was trying to add a second list inside of another list. This was causing the whole thing to have problems. It is working now.

    Read the article

  • using Jquery, replace html elements with own values

    - by loviji
    Hello, I have a table, has many rows. for example one of from rows(all rows are same): <tr> <td> <input type="text" /> </td> <td> <textarea cols="40" rows="3" ></textarea> </td> <td> <select> //options </select> </td> <td> <input type="text" /> </td> <td> <input type="checkbox" /> </td> </tr> Rows can be dynamically added by jquery after button click. I'm trying to do: after button click add new row(I do it) and replace previous row Html Elements(input type=text, textarea, select, input type=text, /[input type="checkbox" must be safe]) with its own values. And after if i click on row(anyrow), i want to rollback previous operation. i.e. replace texts with html element. and htmlElement.val()=text. Added after 30 minutes: I wrote for input type=text element and textarea element this. $("#btnAdd").click(function() { $input = $('#mainTable tbody>tr:last').closest("tr").find("td > input:text"); $input.replaceWith($input.val()); $textArea = $('#mainTable tbody>tr:last').closest("tr").find("td > textarea"); $textArea.replaceWith($textArea.val()); }); is this a good idea?

    Read the article

  • Cant get the height of the div in html

    - by user3326265
    I have assigned the 80% height of the viewport to my div as height. In Button click i have displayed the height of the div. This works fine in ie9, ie10. But in ie7, ie8 $("#divContainer").height() is 0. Am i doing anything wrong and how to get the height of the div in IE7, IE8(vml) <html style="height:100%;"> <body style="height:100%;"> <div id="divContainer" style="height:100%; border:2px solid #ff0000"> </div> <button id="button1"></button> <script type="text/javascript"> $(function () { $("#button1").click(function() { alert($("#divContainer").height()); }); }); </script> </body> </html> Thanks In Advance

    Read the article

  • Accessing HTML DOM elements from javascript using `.childNodes`

    - by Martin
    I'm wondering about the .childNodes property, I have the code below, and for some reason I get 18 children, while 6 are HTMLInputElements as expected, and the rest are undefined. What is this about? Is there an efficient way to iterate over the input elements? <html> <head> <script> window.onload = function(e){ form = document.getElementById('myForm'); alert(form.childNodes.length); for(i=0; i<form.childNodes.length; i++){ alert(form[i]); } } </script> </head> <body> <form id='myForm' action="haha" method="post"> Name: <input type="text" id="fnameAdd" name="name" /><br /> Phone1: <input type="text" id="phone1Add" name="phone1" /><br /> Phone2: <input type="text" id="phone2Add" name="phone2" /><br /> E-Mail: <input type="text" id="emailAdd" name="email" /><br /> Address: <input type="text" id="addressAdd" name="address" /><br /> <input type="submit" value="Save" /> </body> </html>

    Read the article

  • Is there anyway to show a hidden div in the last row of a html table

    - by oo
    i have an html table. here is a simplified version: <table> <tr> <td><div style="display: none;" class="remove0">Remove Me</div></td> </tr> <tr> <td><div style="display: none;" class="remove1">Remove Me</div></td> </tr> <tr> <td><div class="remove2">Remove Me</div></td> </tr> </table> i have javascript that clicks on Remove Me in the last row and it deletes the html row using: $(this).parents("tr:first").remove(); the issue is that when i remove this last row, i also want the "Remove Me" text to now show up on the second row (which is now the new last row). how would i show this div so that it would dynamically show the "remove me" from the new last row?

    Read the article

  • Search and highlight in html with multiple keywords as a single string

    - by Qiusheng
    In JavaScript, by given a html string with tags like: This string has different fonts. <b>This</b> <i>string</i> <span style="background-color: rgb(212, 239, 181);">has</span> <b>different</b> <i>fonts</i>. When user searches for a search term with multiple words like "different fonts". How can I add highlighting to make the html string look like: <b>This</b> <i>string</i> <span style="background-color: rgb(212, 239, 181);">has</span> <span class="highlight"> <b>different</b> <i>fonts</i> </span>. Please note that the search term is treated as a single string as if the words are in a quote, so I cannot search and highlight each word individually.

    Read the article

  • HTML form never calls Javascript

    - by user1205577
    I have a set of radio buttons defined in HTML like so: <input type="radio" name="group" id="rad1" value="rad1" onClick="doStuff(this.id)">Option 1<br> <input type="radio" name="group" id="rad2" value="rad2" onClick="doStuff(this.id)">Option 2<br> Just before the </body> tag, I have the following JavaScript behavior defined: <script type="text/javascript"> /*<![CDATA[*/ function doStuff(var id){ alert("Doing stuff!"); } /*]]>*/ </script> When I run the program, the page loads as expected in my browser window and the radio buttons allow me to click them. The doStuff() function, however, is never called (I validated this using breakpoints as well). I also tried the following just to see if inline made the difference, but it seems the JavaScript is never called at all: <script type="text/javascript"> /*<![CDATA[*/ alert("JavaScript called!"); main(); function main(){ var group = document.getElementsByName('group'); for(var i=0; i<group.length; i++){ group[i].onclick = function(){ doStuff(this.id); }; } } /*]]>*/ </script> My question is, is there something special I need to do using HTML and JavaScript in this context? My question is not whether I should be using inline function calls or whether this is your favorite way to write code.

    Read the article

  • How to store arbitrary data for some HTML tags

    - by nickf
    I'm making a page which has some interaction provided by javascript. Just as an example: links which send an AJAX request to get the content of articles and then display that data in a div. Obviously in this example, I need each link to store an extra bit of information: the id of the article. The way I've been handling it in case was to put that information in the href link this: <a class="article" href="#5"> I then use jQuery to find the a.article elements and attach the appropriate event handler. (don't get too hung up on the usability or semantics here, it's just an example) Anyway, this method works, but it smells a bit, and isn't extensible at all (what happens if the click function has more than one parameter? what if some of those parameters are optional?) The immediately obvious answer was to use attributes on the element. I mean, that's what they're for, right? (Kind of). <a articleid="5" href="link/for/non-js-users.html"> In my recent question I asked if this method was valid, and it turns out that short of defining my own DTD (I don't), then no, it's not valid or reliable. A common response was to put the data into the class attribute (though that might have been because of my poorly-chosen example), but to me, this smells even more. Yes it's technically valid, but it's not a great solution. Another method I'd used in the past was to actually generate some JS and insert it into the page in a <script> tag, creating a struct which would associate with the object. var myData = { link0 : { articleId : 5, target : '#showMessage' // etc... }, link1 : { articleId : 13 } }; <a href="..." id="link0"> But this can be a real pain in butt to maintain and is generally just very messy. So, to get to the question, how do you store arbitrary pieces of information for HTML tags?

    Read the article

  • problem with the table width in IE?

    - by Harish Kurup
    I am using table to display a set of data, my HTML code goes here... <table border="1" cellspacing="0" cellpadding="0" style="width: 780px;"> <tbody> <tr> <td style="width: 780px; height: 25px;"> <pre width='100' style='width: 780px; word-wrap: break-word;'> the data goes here..... </pre> </td> </tr> <tr> <td style="width: 780px; height: 25px;"> <pre width='100' style='width: 780px; word-wrap: break-word;'> the data goes here..... </pre> </td> </tr> </tbody> </table> this table works ok in firefox, safari, and IE8. But the problem arise in IE7, IE6.. asthe table expands and goes out of the screen(i.e expands towards right hand side in x-axis).... is there any hack to fix it?

    Read the article

  • style ul with width to accommodate items

    - by Tallmaris
    Sorry I could not find a similar answer on SO. I have the following markup (generated by jquery ui autocomplete but this is not the issue here) <ul style="z-index: 1; display: block; border: thin solid red; width: 200px;"> <li> <a> <div style="font-size: 0.85em;"> <span style="float: right; padding-left: 10px; color: gray;"> United Kingdom </span> <span style="">text text text text text</span> </div> </a> </li> </ul> As you can see in this fiddle: http://jsfiddle.net/fVr8P/2/ the text wraps because the width is limited and the country span is "floating". What I would like would be for the width to enlarge to accommodate the full length, but if I put width: auto; it will expand to 100%. Background The ul is of course coming from jquery ui autocomplete. I am styling the results a bit using the autocomplete.html extension. Problem is that everything is working ok in firefox an chrome because the autocomplete is set to the correct width on creation. in IE this does not happen (width is too small) so the text wraps. I am hping to come to a simple css only solution, without fiddling around in jQuery.

    Read the article

  • How To: Custom HTML / CSS Text Button for "Facebook like" & "Twitter Follow"

    - by 1Line
    So i have had a little hunt online about creating custom Facebook like buttons and custom twitter follow button but not really found a solution so thought i would ask here and see if anyone knows of a solution for this (currently i have coded some jQuery to get Facebook and Twitter counts using JSON which works but want some custom buttons as per below) I have the count working all ok, just need to tackle the like and follow buttons - it is done in jquery at the moment so would like to continue to use that if this has to be done via that. at the moment i use the API for each to get the count, if i can integrate into the current js i have to get the calls / functions i require would be good: // grab from facebook var facebook = $.getJSON('https://graph.facebook.com/'+f_page+'?callback=?', function(data) { fb_count = data['likes'].toString(); fb_count_gt = data['likes'].toString(); fb_count = add_commas(fb_count); $('#fb_count').html(fb_count); }); // grab from twitter var twitter = $.getJSON("https://twitter.com/users/"+t_page+".json?callback=?",function(data) { twit_count = data['followers_count'].toString(); twit_count_gt = data['followers_count'].toString(); twit_count = add_commas(twit_count); $('#twitter_count').html(twit_count); }); Thanks in advance!

    Read the article

  • Regular Expressions, avoiding HTML tags in PHP

    - by Jason Axelrod
    I have actually seen this question quite a bit here, but none of them are exactly what I want... Lets say I have the following phrase: Line 1 - This is a TEST phrase. Line 2 - This is a <img src="TEST" /> image. Line 3 - This is a <a href="somelink/TEST">TEST</a> link. Okay, simple right? I am trying the following code: $linkPin = '#(\b)TEST(\b)(?![^<]*>)#i'; $linkRpl = '$1<a href="newurl">TEST</a>$2'; $html = preg_replace($linkPin, $linkRpl, $html); As you can see, it takes the word TEST, and replaces it with a link to test. The regular expression I am using right now works good to avoid replacing the TEST in line 2, it also avoids replacing the TEST in the href of line 3. However, it still replaces the text encapsulated within the tag on line 3 and I end up with: Line 1 - This is a <a href="newurl">TEST</a> phrase. Line 2 - This is a <img src="TEST" /> image. Line 3 - This is a <a href="somelink/TEST"><a href="newurl">TEST</a></a> link. This I do not want as it creates bad code in line 3. I want to not only ignore matches inside of a tag, but also encapsulated by them. (remember to keep note of the / in line 2)

    Read the article

  • Write a completely fluid HTML page (using '%' instead of 'px' for EVERY element height/width)

    - by barak manos
    I am designing my HTML pages to be completely fluid: For every element in the mark-up (HTML), I am using 'style="height:%;width:%"' (instead of 'style="height:*px;width:*px"'). This approach seems to work pretty well, except for when changing the window measurements, in which case, the web page elements change their position and end up "on top of each other". I have come up with a pretty good run-time (java-script) solution to that: var elements = document.getElementsByTagName("*"); for (var i=0; i < elements.length; i++) { if (elements[i].style.height) elements[i].style.height = elements[i].offsetHeight+"px"; if (elements[i].style.width ) elements[i].style.width = elements[i].offsetWidth +"px"; } The only problem remaining is, that if the user opens up the website by entering the URL into a non-maximized window, then the page fits that portion of the window. Then, when maximizing the window, the page remains in its previous measurements. So in essence, I have solved the initial problem (when changing the window measurements), but only when the window is initially in its maximum size. Any ideas on how to tackle this problem? (given that I would like to keep my "% page-design" as is).

    Read the article

  • MySql - JSON data not showing in html

    - by Ramzie
    I'm trying to create a drop down list from a MySql. The php is successfully fetching the data from the MySql. But my problem is the data is not showing on the drop down list in my HTML page? json_mysql_data2.php header("Content-Type: application/json"); require_once("con.php"); $i=0; $jsonData = array(); foreach ($conn_db->query("SELECT customerID FROM customers WHERE furniture='33' ") as $result){ $i++; $jsonData["article".$i]=$result['customerID']; } echo json_encode($jsonData); myJS.js $(document).ready(function(){ var ddlist = document.getElementById("ddlist"); var hr = new XMLHttpRequest(); hr.open("GET", "json_mysql_data2.php", true); hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); hr.onreadystatechange = function() { if(hr.readyState == 4 && hr.status == 200) { var d = JSON.parse(hr.responseText); for(var o in d){ if(d[o].title){ ddlist.innerHTML += '</option><option value='+d[o].title+'</option>'; } } } } hr.send("null"); ddlist.innerHTML = "Loading Customer ID...."; }); html <script src="myJS.js" type="text/javascript"></script> </head> <body> <div class="dlist"> Customer ID: <select id='EmpLst' name="dwlist" onchange='document.getElementById("val1").value = this.value;'><option value="">SELECT STUDENT ID</option> <div id="ddlist"></div> </select> </div>

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >