Jump to content

Leaderboard


Popular Content

Showing most liked content since 10/15/2017 in all areas

  1. 1 point
    According to the documentation for the ajax method, beforeSend is called before the request is even sent. The 2 parameters that the function gets passed are the jQuery XHR object, and the settings object. So in your code, podType is set to the jQuery XHR object. The beforeSend function is really for modifying the request before it goes out (or canceling it), so I would think your code for changing the page should all go in the success function. Inside that success function podType will still have the value it had when you send the request, unless you change the value inside the function. You also need to quote all of those values in your case statements, otherwise you're trying to compare the value with different variables.
  2. 1 point
    .w3-cell-row { margin: auto; margin-top: 0; width: 79%; border-collapse: collapse; /* margin-bottom: -10px;*/ } .w3-cell { background-color: #fff; border: 5px solid #00c; /* margin-bottom: -10px;*/ border-bottom: none; } .w3-cell-row:before, .w3-cell-row:after { content: none; } .w3-cell-row:last-child {border-bottom: 5px solid #00c;}
  3. 1 point
    Yes, you would use an array of objects as shown. As far as file types, it's not very common to have a static file only containing JSON that you read from, they just do that because it's an easy example. It's more likely that you'll be sending ajax requests to PHP or another language on the backend which would dynamically generate the JSON (from a database, as in your example). You can use PHP or whatever language to set the content-type for JSON though, rather than saying it's HTML.
  4. 1 point
    You can use a php function called is_numeric(). if(is_numeric($var)) { //do stuff } else { //do other stuff } Hope this is what you want.
×