Skip to content
Advertisement

Tag: javascript

Change image with and js

I have a small slider that switches the preview image to the main image. It works fine now blade.php js But I still have a picture mobile_image, and I want the mobile_image to change instead of main_image at the maximum size of 576px, for this I use <picture> I change my code to like this But my slider just stops

Load JSON File and print specific Parts

im building a simple webpage for school. Sadly ive got several problem. Im using an Apache Webserver with XAMPP. I got a JSON-File like: This file is on my Webserver too. I want to load this file especially with XHTML Request and then want to print several parts of this JSON File into HTML/PHP Code. I watched a lot of

The value of my variable is changing In another file

I got this varible: My problem is that the user can change the value in #box. So it contains x different li:s then my var things is not set anymore. How do I change this var? var things is in my index.php file. The place where the user changes the #box is in my change.php file, so I think It’s

Trailing html with ajax response form php

I am trying to send info to a php file from an html form. The form works just fine and php processes the information correctly but I am having trouble with the response from the callback. Here is the javascript code: Here is the php code: } Everything works fine except for the response from the call back. Here is

Change which a-tag is highlighted depending on active page

So I have a menu with different items The class=”active” highlights the menu item, and I was wondering how I could make this class change depending on which page I was on. So if the user visited Archives, then that has class=”active”. The class is just a simple color All my html code is run inside php files. UPDATE Might

is `file_get_contents(“php://input”)` the only way to get post data from `fetch` and is it safe to use async- and hack-wise?

I’m trying to rewrite my JQuery $.post() code via native fetch() function. And it seems like the only way to do it with PHP server code is using file_get_contents(“php://input”). I do it like it is shown here and here: js code: myscript.php: There are two things which makes me worried: The project has more than one fetch call like this.

Advertisement