Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About Texan78

  • Rank
    Advanced Member
  1. When the script inc/alertsUS.php script is updated by the AJAX script there is an icon on the divs which in this case is a link to open a modal for more information. When the page is first loaded the links work fine and open the modals and the modals are populated with the correct information. BUT if there is new data that means a new div is generated in which case that link is not clickable. If I refresh the page then I can click the link. After doing research I discovered this is because the click event needs to be binded. So that is what I am trying to accomplish is so that when new da
  2. The content of #svrAlertsUS isn't what is getting injected into the modal. That just displays the page from inc/alertsUS.php in DIVs where I want the data outputted. That ID is the AJAX ID to that script if that makes sense and I am explaining it correctly. I have tried this but it's not working ether function auto_load(){ //National Warning & Watches Settings $.ajax({ url: "inc/alertsUS.php", cache: false, success: function(data){ $("#svrAlertsUS").html(data); } }); } $(document).ready(function(){ $('#svrA
  3. Yeah that makes sense and something I had thought about if I needed to go higher up. I had tried that but I didn't go outside the script being called by the AJAX. I just wrapped the entire modal in a new ID etc. So as you can see from my first post the AJAX calls an ID svrAlertsUS. On the page which the divs with the data being displayed it is in a container like so... <div id="alertsUS-expanded" class="collapse"> <div id="svrAlertsUS"></div> </div> So since the ID svrAlertsUS is the container would this work? $('#alertsUS-expanded').on('click', 'a', functio
  4. I have some some divs which are dynamically created from a PHP script and displayed to a page via AJAX so the data in the divs are updated/refreshed when new data is present in a JSON file. These divs have a link on it to open a modal. When the page first loads the links work great. When the script updates the PHP file and there is new data to display on the page the links for the new data do not work. Therefore I have found out I need to bind the event via .on(click). Here is my problem I am running into since they are not static IDs to bind to. The IDs are dynamically produced based on the
  5. Manual shows nothing about the missing echo statement which is what it was. Also the data I was trying to get a response wasn't available in cap+xml only in atom+xml and JSON. So I will be re-writing the scripts to use JSON which is better now that JSON is available now.
  6. Forgive me if this is simple. My research has brought me to a halt at the moment. I am trying to use cURL to get the response of an API in XML. This is the URL of the API: https://api.weather.gov/alerts/active/region/land By default it returns in JSON. Which I know, I should just use the JSON response but, there is a reason I need it in XML as it will seamlessly integrate into my current code until I can rewrite it for JSON. This is the documentation for the API. Under the API Reference tab is states I just need to change the request header to application/cap+xml. But I am not ge
  7. Hello, It's been awhile since I have had to do this and I can't find any of my old code snippets. So having to go from memory. Just trying to start small and add to this. NWS is now has a JSON API where before they had XML/RSS. So I am trying to update or really create new scripts to use this new API before they take down the old method and my site is broke. I have not see this kind of JSON format before so I am a little lost. How would I go about pulling the Event, Sender and Description from the below example? { "@context": [ "https://raw.githubusercontent.com/geojson
  8. Thanks, I am not worried about the other right now. Each their own. Main focus is getting these sorted by priority and I have no idea how to do this and cannot find any examples. I have even been willing to PAY someone to do this since last November for what is probably less than 5 mins of work but can't find anyone. Is what I am asking that difficult? I didn't think it was that difficult, I see sites doing it all the time everyday. I have already tried the array approach and got shot down on here with it and could never get it working.
  9. Hello, I have been struggling with this for months and please be gentle as I am not a coder. Just a hobbyist trying to build a site for my brand. I know just enough to try to do what I need to do so I certainly do not know the best logic. I have been search for months and months for how to do this. I have three events I need to show in a certain order when they display. 1.) Tornado Warning 2.) Severe Thunderstorm Warning 3.) Flash Flood Warning I have them filtered but I am probably not using the best logic for this approach. Is there anyone who could offer some assistance and help
  10. Ok let me try to explain what I am trying to do. The arrary you see is all the active alerts and how many of that alert is currently active. from the "../xml/nat_warnings.xml" There is a possibility of over 116+ events. This is why I created the arrary to only check the ones I want. In this case I just need to total number of alerts for "'Tornado Warning', 'Severe Thunderstorm Warning', 'Flash Flood Warning'" with the ability to add more as needed depending on the season. With the orginal code that filters what I want and gives me to total number of each alert. So what I am needing now is to t
  11. Hello, When I try what you suggested which is this. ini_set('display_errors','1'); ## Start Configurable data ## ##$data3 = "../xml/nat_warnings.xml"; ## End Configurable data ## $sri = htmlspecialchars('Tornado Warning', 'Severe Thunderstorm Warning', 'Flash Flood Warning', ENT_QUOTES); $xml = new SimpleXMLElement("../xml/nat_warnings.xml", 0, true); $xml->registerXPathNamespace("cap", "urn:oasis:names:tc:emergency:cap:1.1"); $count = count($xml->query("/feed/entry[cap:event = '{$sri}']")); print_r($count); Then I get this error. I much prefer SimpleXML but, th
  12. Hello, I am bit stuck and could use some assistance. I am know I need to probably use an array to filter out only the results I need but, the solutions I have tried have not been successful. What I am trying to do is get the total number of certain events within an XML file. I have got it to where it prints out all the events within the XML file but, this is where I am stuck. How to filter out only certain events that I want the value of then get a single total combined number of those chosen events. Here is the test link of what the output looks like now. http://stream.dfw
  13. Always looking for something more significant and it was the easiest thing. -Thanks
  14. Hello, I am looking for some assistance with something I done before but forgot and I can't find my code snippets from when I used this method in the past. If you reference the screenshot below you will see boxes going across. What I am trying to do is put each one on its own row but can't remember how it is done. I have tried putting a <tr> in the loop but that doesn't work which I have commented out below where I had it for example purposes. Could anyone offer some help with this? BTW I am using this with bootstrap and calling it into the HTML template with jQuery so it refreshes
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.