user3754380
user3754380

Reputation: 701

JQuery Load() reloading whole body

I am using a nimbb api to record video using a webcam and the project is very simple.Here is my sample. Once i finish recording i get this message "Your video has been saved. Thank you!". I want to skip this message and reload the div so that webcam loads again. I am doing like this.

            var url ="index.html";

            //alert("yes");
            alert("Your video has been saved. Thank you!");


            $("#re").load(url);

But this is reloading whole body. I just want to load webcam div. What i am doing wrong here?

Upvotes: 2

Views: 227

Answers (1)

charlietfl
charlietfl

Reputation: 171679

Using load() you can target css selectors within the page being loaded. If your div has id="video" for example:

$("#re").load(url + ' #video');

be sure to leave a space between the url and the selector

See loading page fragments section of load() API docs

Upvotes: 6

Related Questions