Skip Navigation

[Gelöst] Javascript loading in ajax view

This support ticket is created vor 4 Jahren, 1 Monat. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 4 Antworten, hat 3 Stimmen.

Zuletzt aktualisiert von Dido vor 4 Jahren, 1 Monat.

Assistiert von: Minesh.

Author
Artikel
#1818159

Hi,
on this website versteckter Link
I use a javascript for the masonry sorting. When I click on a filter, the javascript is not loading, because it is in the header.
When I put the script in the view, I got errors. What can I do to solve this?

#1819105

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

There is a custom JS event that you can use to add back the masonry code (which is lost when a filter is applied), namely

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
	
});

You may like to know if you use Blocks (rather than the legacy Views) then a Masonry grid is one of the output options, you wouldn't need a custom solution.

#1824865

I added the code you provided in the view, but it was not the solution yet.
I will look again to my script. I copied it from the original website, but the maker combined more scripts in one file.
So I will clean it up first.

versteckter Link is the website I have to remake in WordPress.

#1825087

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Ok - please make sure you do not have any Javascript error with your browser's console and yes, please remove unwanted scripts and let me know if you require further assistance.

#1827901

My issue is resolved now. Thank you!