You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until recently, it was only possible to swap content divs with the same ID across pages.
In course of the last changes, I have tried preparing to abstract the code in order to support the swapping of any type of element, that has an ID, i.e. not only divs.
(Why? -> That will be more powerful and flexible for the web designer)
The new img tag tests the new function _copyAttributes() (i.e. copying over the src attribute)
The new h1 tag tests the part with the normal html() (i.e. copying over the tag's inner contents)
Obviously, these are dead-simple test cases, but it is reassuring to see, that they work instantaneously!
It would be great to know, whether the above mechanism also works against more complicated types of tags / elements, such as form...
The text was updated successfully, but these errors were encountered:
Until recently, it was only possible to swap content divs with the same ID across pages.
In course of the last changes, I have tried preparing to abstract the code in order to support the swapping of any type of element, that has an ID, i.e. not only divs.
(Why? -> That will be more powerful and flexible for the web designer)
The new function _copyAttributes() now works and was a pre-requisite for supporting any kind of element.
Swapping any kind of element can now be established, by performing the following two steps, which augment each other:
html()
This issue is, in turn, a pre-requisite for moving towards supporting any kind of elements with ID across pages, even when they are inconsistent, i.e. not present on all pages of the site...
Great news(!):
First tests on this partner site indicate that it might already be working properly...
Description of the (simple) test scenario:
The div with the ID
logo
in the header section of the site... has been enriched with two new elements:
img
tag with the IDprodlogo
h1
tag with the IDprodh1
Pages of the testbed have been divided into three different page types:
Additional HTML for the Home page
Additional HTML for the Product Search page
Additional HTML for all other pages
Finally, the main Ajaxify selection was adapted to:
Desired output for the various pages (
img
withh1
floating to the right):Home
Product search
Normal page
...and it works right away!...
What does this test?
img
tag tests the new function_copyAttributes()
(i.e. copying over thesrc
attribute)h1
tag tests the part with the normalhtml()
(i.e. copying over the tag's inner contents)Obviously, these are dead-simple test cases, but it is reassuring to see, that they work instantaneously!
It would be great to know, whether the above mechanism also works against more complicated types of tags / elements, such as
form
...The text was updated successfully, but these errors were encountered: