Jump to content

Ingolme

Moderator
  • Content Count

    13,688
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by Ingolme

  1. Ingolme

    Image Capture and Display

    If that is the only output of your script then you can make the browser interpret it as an image by sending a content-type header: header('Content-type: image/png'); echo $image_content; If you try to print anything else, like HTML or even just spaces and line breaks, then the image will appear corrupted in the browser.
  2. Ingolme

    jquery functions don't work for axis call

    I'm not sure what axis is, but there's no way to protect Javascript code, as long as the browser is able to run it, it is also available to the person using the browser. My first suggestion would be to rewrite your code to not require jQuery. Everything jQuery can do, native Javascript can do better as long as you're experienced enough to write the code. If you're making requests for content using AJAX and you have code that needs access to HTML elements created by the AJAX request, then you will need to run that code after the AJAX request has been completed.
  3. Ingolme

    Chaining PHP Class Methods

    That will probably work. You should test it to make sure. Run the code and see if it does what you expected it to.
  4. Ingolme

    Chaining PHP Class Methods

    No, it's not equivalent, there are actually two objects there: One is the scheduler and the other is whatever thing the scheduler's php() method is returning. The above code is equivalent to this: $thing = $scheduler->php('script.php'); $thing->hourly(); I don't know what type of object $thing is, since I haven't read the documentation. The concept of chaining is not native to any language, it only happens if somebody designed the objects to work that way.
  5. Ingolme

    iFrame to PDF

    There is no code for that. You would have to study the PDF file format and build software from scratch to do it. It would take an experienced software developer a few weeks to build or even months depending on difficulties encountered during development.
  6. Ingolme

    function call not executing

    You're in way over your head, you still have to learn the basics of Javascript and get familiar with them. You need a solid understanding of event listeners and event handlers before you can move on to big projects such as this one. You should try small exercises for now so that you can learn Javascript properly. A good simple starting project would be to create one event handler that highlights the element that fired the event.
  7. Ingolme

    change loaded page automatically with PHP?

    No, you have to do that with Javascript.
  8. Ingolme

    Data Retrieval - Sundry Formats

    To be certain, I would need to see documentation about the web service that you are making requests to. The first item is a serialized PHP data structure, you convert it back into data using the unserialize() function. I am willing to bet that the second item is XML, but since you have loaded it into a browser, the tags are being parsed and only the text content is being shown. If you want to actually see the XML tags in the browser, you either have to send a "text/xml" content type header or pass the data through htmlspecialchars(). While seeing the data is useful for debugging, ultimately, you don't really want to do that. What you should do with the XML response is create a DOMDocument for it so that you can retrieve the data contained within it.
  9. Ingolme

    iFrame to PDF

    You can search for HTML to PDF converters, but I don't think they can handle iframes. If none of the existing tools available can handle iframes, you might need to reconsider your requirements. This project would likely take several weeks of research and development.
  10. Ingolme

    function call not executing

    Here's a tutorial describing how to use events properly: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_objects
  11. Ingolme

    function call not executing

    The variable event is not defined. What is event for? If you don't know what it is for, that's an indication that you have been copying code without understanding it.
  12. Ingolme

    header info query

    If it returns false it probably means that it could not connect to the URL. file_get_contents() will get files from your local server. Depending on your server's configuration it might not be allowed to load files from remote servers. I recommend using cURL to load files from other websites: http://php.net/manual/en/book.curl.php
  13. Ingolme

    header info query

    Use var_dump() on the output of the get_headers() function and see what it shows. I doubt $_SERVER["yahoo.com"] would have anything in it, the $_SERVER array just contains some information about the server that the PHP code is running on.
  14. Ingolme

    Closing a modal box

    Yes, it is automatically hidden with CSS by using display: none. .modal { display: none;
  15. Ingolme

    function call not executing

    You have a variable called "event" which is not defined anywhere. What is it for? Unrelated to the issue, your code has four if statements doing the exact same thing, you should put them together with an OR operation like this: if(temp1 == 1 || temp2 == 1 || temp3 == 1 || temp4 == 1) { openCity(event, 'temperature'); } else { func(); } These variables "temp1", "temp2", "temp3" and "temp4" don't seem to be defined anywhere either. You need to define all of your variables and all of your functions.
  16. What string are you looking for? The element's tag name or the content within the element? What do you want to do with the string once you have it?
  17. Ingolme

    onload event

    You cannot have more than one <body> tag in the document and all of the page's content must be inside that <body> tag. You should use addEventListener if you need more than one function to run when the window loads.
  18. Ingolme

    CSS Attribute-Selectors5

    Please read the CSS reference, there is an entire page describing each of the selectors that you are asking about: https://www.w3schools.com/cssref/css_selectors.asp
  19. Ingolme

    CSS Attribute-Selectors4

    You should check the reference, it is described on this page: https://www.w3schools.com/cssref/sel_attr_begin.asp It's called a caret and it is used to select elements which have attributes that begin with the specified value. Here is the full CSS selector reference, each one of them is described in detail: https://www.w3schools.com/cssref/css_selectors.asp
  20. Ingolme

    CSS Attribute-Selectors2

    It's in the HTML tutorial. https://www.w3schools.com/html/html_links.asp You should finish the HTML tutorial before beginning to learn CSS.
  21. Ingolme

    Closing a modal box

    It's the .modal:target selector that is doing the work. :target selects any element which has an ID attribute that is being referenced by the hash part of the URL.
  22. Ingolme

    Ajax inside of Ajax?

    You've put the open() and send() methods of the second request inside of the onreadystatechange handler.
  23. Ingolme

    onload event

    If you don't need it in the paragraph element, then remove the line of code that does that. Just delete this line, but keep all the rest of the code the same: document.getElementById("hw_maj").innerHTML = this.responseText; You need to understand what each line of code is doing. You should also delete that <p> element from your HTML since you're not using it.
  24. Ingolme

    onload event

    Is it not doing that?
  25. Ingolme

    CSS Attribute-Selectors2

    Are you asking about the selector or about the target attribute? The selector only will style an element which has a target attribute with value "_blank" The target attribute tells a link in which window or frame a link should open. "_blank" tells the browser to open a link in a new tab. "_top" will make a link that is inside of a frame open in the window that is containing the frame rather than staying inside the frame.
×