I am currently developing a widget for elementor and i have already done the PHP render part as it renders the HTML part dynamically. Now, i want to do same for js render part as live rendering. I thought of Ajax call so that I can get data from it and place it on js render part. I tried to Ajax call inside _content_template() function but it load first instead of HTML while adding it to the post while PHP render is fine. How can i handle this. Please any help is appreciated.
Related
I'm working on an app using Express.js and Handlebars. I want to have a page where you can enter text into a search bar, and the view will update to display the results of your search. The backend part of this is already working - the data is being retrieved just fine - but I'm not sure how to best go about updating the view.
I'm using express-handlebars for this app, so the views are formatted as .handlebars files, and being sent to the client via the res.render method. I have seen examples of, for instance, using a button to fill out a Handlebars template, but these examples use a static HTML file with a template in a script tag; I don't know how to translate that to what I'm working with.
I would like to build the equivalent of a _layouts.cshtml page that I can use with every page in my web app. I don't want to use cshtml or razor though I want to use html. Is there a simple way to convert the _layouts page to standard html and then include it with the other pages in the app?
I have inherited an app that uses cshtml, with a _layouts page for menus and some content styling used on each page. I can duplicate the content on every page, but would prefer to have a generic solution for it. The client does not want to use cshtml pages. Any java library, such as AngularJS that would provide tools is ok for me to use. I'm not a front-end guy and this is a relatively low budget operation where I'm working for free. TIA.
i'm not familiar with .cshtml but on an html page you could use an iframe and update the contents of the iframe with different pages as needed.
you could also get external html and put it on the current page using jquery's get().
// get the contents of 'test.html' and put it into the 'result' element
// on the current page.
$.get("ajax/test.html", function(data) {
$(".result" ).html( data );
alert("Load was performed.");
});
Hi I'm pretty new to contact form 7. I've seen on Youtube tutorials, that contact form 7 submits without page refresh. But when I install the plugin it's working with a page refresh.
Please advise on how to enable it to work without page refresh. Thanks.
I found the fault, the issue was i haven't included the wp_head() and wp_footer() functions in my theme.
There's a page in contactform7 site on this:
https://contactform7.com/why-isnt-my-ajax-contact-form-working-correctly/
there they have mentioned the requirements for ajax to work.
Add wp_head() funtion in your header.php file and wp_footer() function in footer.php file.
That's it solved :)
My problem was solved by changing the jquery used. Check the version you are using.
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous">
enter code here
</script>
I have recently experienced this problem. I have opening a form inside popup and submit would refresh it.
So, after some much hair pulling I happened to view source and there I noticed some part of footer code wasn't highlighted. Why? turns out it was my silly mistake. I forgot to close one iframe tag. Once I closed it. view source code was perfectly highlighted and the problem was resolved.
After verifying that one of the main reasons why the page refreshes when submitting the form are:
JavaScript file is not loaded:
If you are using themes downloaded from the store, usually the problem is with page optimizers like Lite Speed Cache.
Otherwise check that your themes are loading the Ajax file correctly.
This was my case, the Js files were loading in delay, I was using a Page Cache which was speeding up the web page but not loading the javascript files correctly.
Conflicts with other JavaScript
HTML structure is not valid
I have a asp.net website with some header links in master page. For some of them I added link to jQuery mobile script to format those specific pages (forms) to look good on phones/tablets.
But after I load one of those pages and then click on some other page, it somehow caches the current page and although I can see the correct page being loaded for split second, it then reloads previous page. I don't know why this happens, but I know that culprit is the jQm link, because if I remove it, it works like expected (without the mobile design though).
I don't use data-role="page" attribute or anything, just classic asp.net page.
jQuery Mobile uses it's own kind of navigation model by default. It injects multiple specifically formatted pages into current page using AJAX. You probably need to disable it using code snippet below:
$( document ).on( "mobileinit", function() {
$.mobile.ajaxEnabled = false;
});
For more information check jQuery Mobile documentation navigation model and global configuration pages.
I am using TinymceBundle with symfony2.1. The plugin work perfectly with any page except Ajax request. I understand that in order for tinymce to work, some javascript need to run to change textarea to wysiwyg. I am using https://github.com/stfalcon/TinymceBundle.
You might need to include the tiny_mce.js.
Check that this file is loaded on your page.