auto load registration form popup on checkout - magento

i am working on oncepagecheckout, there is a link "Click here to login or create a new account", However we click on this link a popup of login form does display. but i want to display this login popup form should display automatically on page load, Kindly help

You can easily do that with jQuery. Just use below code, this will trigger a click onload of page. Just check the id of the button and replace that in the below code:
<script>
$(document).ready(function(){
$('#your_button_id').click();
});
</script>

Related

Menu Item with JavaScript

The Abp documentation describes how the menu's associated JavaScript files are automatically generated by the framework based on NavigationProvider class.
My question is: has anyone tried extending the abp.nav.menus JavaScript files produced on the client-side?
If so, would you able to provide a code snippet(s) on how to assist?
My intention is to create a menu item that execute a JavaScript function rather than url, which redirect to a new page. For example, to open a modal dialog box on top of existing page.
Thanks.
You can do it with JQuery. Enter # for the menu link and set click with JQuery.
$($("#leftsidebar .menu ul li a")[2]).click(function(e){
e.preventDefault();
window.location = "https://www.google.com";
});

Remain within magnific popup

I have an ajax popup working nicely with Magnific Popup. However the page that I am loading into the popup via the ajax call contains a hyperlink.
The only contents of the page is:
test
When I click on the "test" link "anotherpage.html" loads in the original parent window.
Is it possible for the page that this link points to to be loaded in the same popup window?
you can achive this effect by following these steps:
download the html page with jQuery into a temporay variable
from the variable get the link address
send Magnific Popup the link you want to display in the first place
for the first part, you can you this great post on stackoverflow: How do I load html into a variable with jquery
for the second task, all you need is to query the first (and only) link in your html page and get it's href attribute:
var target = $('a:eq(0)').attr('href');
now that 'target' variable stores the requested url - send it over to Magnific Popup
include a empty iframe in the popup.
create a function onclick in Test for change the src of iframe and hide or destroy the old thinks in the popup,

KendoUI: TabStrip Redirect Page in Content of Tab

I have a TabScript and in the content of that TabScript I have a button. So when I click on the button it will redirect to the other page. But is there any way to make it just redirect in the content of the TabScript, not refresh the page?
Thanks!
When the buttons is clicked you can perform you own $.ajax request and set the result returned from the server to be the html of the contentElement.

How to automatically reload website visitora page when browsing?

Here is the case.
I have a website built in asp.net mvc3 with custom CMS.
Is there any way by clicking a button from cms to reload the page of the website visitors?
For example, here in stackoverflow, if an admin from the backend pressed a button my page would reload automatically (or even a lightbox would appear, or redirect me to a different page).
Can we do that?
With HTML5 you can use web workers to do this for you: http://html5demos.com/worker
Without HTML5, you can set up some basic polling code in your javascript. It would call a method on the server that would tell it whether or not to reload. You can run this every 30 seconds let's say:
$(document).ready(function(){
var doRefresh = function(){
$.get('checkForRefresh', function (data) { ... handle response ... });
};
setInterval(doRefresh, 30000);
});
And then just have your checkForRefresh server side code read a value set by that CMS button.
Forcing a reload on a button click boils down to something like this (using jQuery and javascript):
<script type="text/javascript">
$(document).ready(function() {
$('#Button1').click(function() {
location.reload();
});
});
</script>
The first answer on the following question shows two ways to refresh the page, one forcing a reload like above, and the second, much like #Milimetric describes in his answer:
Refresh (reload) a page once using jQuery?.

ASP.NET MVC | How to fire Ajax when I click in combobox in Telerik TreeView

I am using Telerik TreeView control. I set up it to use check boxes. When I click in combobox I want to fire Ajax request to action in controller. Then I want to reload some part page. How to fire Ajax to action by clicking in combobox?
You could register for the click event:
$(function() {
$('#treeViewId :checkbox').click(function() {
// when a checkbox is clicked
// fire an AJAX request to some action
// and refresh the contents of some div
$('#someDiv').load('<%= Url.Action("someaction") %>');
});
});

Resources