Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. If this is running in your local filesystem then your browser security settings may be preventing scripts from accessing the text file. It is best to test AJAX in a real server environment.
  2. Perhaps your database connection code needs to be set to use UTF-8.
  3. The reason is that the top border always goes above the content while the bottom border goes below it. To do the upside-down trapezoid, it might be better to put the border on the ::before or ::after pseudo-element and position that inside its container behind the text.
  4. Remove float: left from the gallery and add text-align: center. You're missing a semi-colon after width: 90%, so it's not being interpreted correctly.
  5. All those backslashes are probably going to cause a problem. Other problems are that no code will run after a return statement and the browser will leave the page as soon as you assign a value to location.href. This button could easily be replace with a link and would not need any Javascript at all.
  6. You will need to include a script file on your page to use it, but you might not need to host it on your own server if they are offering a CDN.
  7. RSA is not a native Javascript object, you will have to find a library. Wherever you found that code should have some documentation telling you where to get the library.
  8. It might fire an onerror event if the server is unavailable A server might decide to stream a string of zeroes to anybody who opens a connection, I can't be sure because I haven't carefully researched streaming protocols.
  9. The "canplay" event fires only once, as soon as enough content has been downloaded that the play button can be pressed. If the server opens a connection and streams empty data to you any time you try to connect, there is no way the browser can know whether the content that is being streamed is meaningful to the user or not.
  10. The return keyword makes it stop right after the first function call. This is why it's better to use addEventListener() to attach events.
  11. Could you describe what inputs and outputs you are expecting?
  12. You can set the page-break-inside property of the image to try to prevent it from breaking.
  13. Without any demonstration of the problems or even an accurate description of what's occurring, we cannot know anything about your problem. We also need to know the code that is producing the page. As for your goal to have your page exactly the same on all monitors, that's impossible. Some monitors simply cannot fit certain designs, the pages have to be built in such a way that the content is rearranged to best suit each device.
  14. The error message you showed earlier "Call to undefined function random_bytes()" is an indication that the code was not running on a server with PHP 7. Can you show me the file where those syntax errors are? They're not in the initial code you posted.
  15. You shouldn't be trying to shift the blame of your problems to other people. The people developing these things don't have the time or incentive to sabotage their own software. Your problem is that the software requires PHP version 7, as stated in the system requirements on their website: https://swiftmailer.symfony.com/docs/introduction.html. The random_bytes() function is exclusive to PHP 7, your server is probably running PHP 5.x.
  16. 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.
  17. 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.
  18. That will probably work. You should test it to make sure. Run the code and see if it does what you expected it to.
  19. 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.
  20. 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.
  21. 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.
  22. No, you have to do that with Javascript.
  23. 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.
  24. 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.
×
×
  • Create New...