redcoder
redcoder

Reputation: 2333

how to load iframe concurrently using javascript

how can i load load iframe concurently using javascript or jquery? Example :I have iframe[0], iframe[1], iframe[2], iframe[3], how to load them concurrently?

Upvotes: 0

Views: 70

Answers (2)

Realitätsverlust
Realitätsverlust

Reputation: 3953

The usage of jQuery is all fine, but its possible with pure JS too, even IE8 supports it. ;)

el.setAttribute('attribute', value);

In your case, it would be:

el.setAttribute('src', 'the/path/to/whatever');

Upvotes: 0

Ionică Bizău
Ionică Bizău

Reputation: 113335

Set their src attribute:

$("iframe").each(function () {
  $(this).attr("src", ...);
});

Upvotes: 3

Related Questions