I'm building a multilanguage site and i am using the l10n.js library, the example doesn't come with links to refresh the language on user's choice, so i create 2 buttons but they only work if the user refresh the page manually, it only works the first time you click, then you gotta click again and refresh manually...
I'm not a java expert but i can understand the logic, so i tried with different window.location.href but none of them seems to work. here is the fiddle if somebody can take a look, thanks.
fiddle
ud1o0ddk
It's working now, i did add window.location.reload(true), I will leave it there just in case somebody else need it.
Related
Has anyone ever experienced any specific problems relating to the use of jQuery, Ajax events and iOS?
I'm working as a web analyst and on our site we are having issues with iOS in the checkout, we are using jQuery and Ajax events to handle the shopping basket in the background, carry the product information from page to page etc and I'm just taking a stab in the dark because I'm pretty sure it's not the html or css that is causing the issue.
The continue buttons that take you to the next page in the checkout use this href:
Continue
From a little research I found out that a # href just takes the scroll position back to the top, and this does occur on iOS, the html seems to be working, but then the jQuery is supposed to kick in when it detects a click of a href with this class, but it doesn't, scroll position goes back to the top and then nothing happens.
Look I know it's really difficult to make any suggestions without seeing any code, I'm just taking a stab here in the hope someone might go "Oh yeah it could be this".
Try changing href="#" with href="javascript:void(0);"
Add event binding code inside document ready function like this
$(document).ready(function(){
//Event binding code
});
This is a little hard for me to explain as i am not much of a coder. So here we go.
I have script that is mostly encoded with ion cube. Not i have an addon that is also encoded. The addon is loading in a tab number 5. The problem is that every time i click on a function in the tab that complete page reloads, and you have to navigate back to tab 5 to see the results.
So this is what i am thinking. As i can't edit code and the make of the code doesn't know when they are adding tab support to their little piece of code. i figured that there are two options
1 Force the following variable to the end of the url #tab5 so that when people click a function they will not have to navigate back to the tab. How do i do this coding wise, javascript or something else and what would code be or where would i look to code something like that. I have looked everywhere but nothing really applies to my situation
2 I think it would also work if each function which is called just reloads that section of the page in an ajax field so that not the full page is being reloaded.
Who can help find the right solution.
thanks
I'm quite bad with Javascript and I can't work out a solution I need help to. I'm having a website and I'm trying to make a redirection to another site, but through a popup.
Example :
<script>alert(This will prompt up the message)</scrip>
<script>window.location="http://This-will-redirect-me-to-another-link.com";</scrip>
Like you can see I could simply use the second javascript to redirect the persons to another page, but due some reasons I can't use it as it will work only for half of the page(the script would be kinda 'sandboxed'), but if I'd make a popup(the first alert script) the second script would get out of the 'sandbox'. Is there anyone who has any ideas how I should implement this or can it be done otherwise with PHP or HTML?
I'm having a MyBB forum and there's a shoutbox for it which I'm using. There's a command which will change the notice of the shoutbox and the command is as such /notice New notice | But I noted that the new notice can be changed with javascript and it'll work such as /notice js code here | Then I thought that what if I would make such a javascript that would redirect people to another webpage. As I'm having such a forum where it's needed to redirect from the main page to another one, I'd like to apply it. Then Staffs could do it in the forum very well, but there's a problem. by adding
/notice window.location="http://This-will-redirect-me-to-another-link.com";
It'll affect only the shoutbox and shoutbox is being redirected to another webpage, but as an alert works for the whole forum I thought maybe I can redirect them to somewhere else with the alert. I want to know is it possible with just one script then Staffs would be able to do it. I know it's a serious security risk & it can be otherwise also, but I'd really like to experiment with it.
I hope someone can help. :)
Try:
window.open('url to other site', 'window name', 'width=900,height=650,scrollbars=yes');
If I understand you (if not please correct me), you can put a tag on popup or another place:
<a href="http://another.site.com/"
onclick="return confirm('Do you want to see another page?');">Redirect</a>
I'm trying to create a login system like http://us.battle.net/en/. The page is fully functional, then when you click on the "Log In" link, the page becomes dark and you can no longer interact with any of the images or links from the original page. A square box comes up, which you can interact with to login to the site, put you can still see everything from the original page.
I've been searching and searching and I can't find what I'm looking for. I just need some ideas to get me pointed in the right direction and I can go from there.
Thanks everyone!
Maybe something like jQuery UI Dialog could help you. Checkout the modal example.
Have a look into Colorbox - it's a jQuery plugin, very easy to use, and does exactly what you want.
The effect of graying out the page and showing a popup dialogue box is called a "modal" dialogue box.
I believe the functionality you are referring to is called a lightbox.
There are dozens of jQuery lightbox plugins around, a quick Google search suffices; FancyBox, for example, is a pretty nice one.
I know this is a problem I could solve with a huge list in "innerHTML", but there's got to be a better way.
I'm making a webpage with a "search" and "browse" section, both are big buttons at the top of the index page. I have search.html and browse.html, but I want their contents to load in my "main" div on the index page rather than open their own pages. I should be able to quickly click between "search" and "browse" and have their different pages load back and forth inside the index page. Hopefully that makes sense. I was trying a solution with frames before, but it wasn't working for me.
Any advice would be greatly appreciated.
Thanks!
You can use tabs or something like that: http://jqueryui.com/demos/tabs/
Most JavaScript AJAX libraries such as jQuery have this built-in - in case of jQuery the load method.
However keep in mind, "tricks" like this destroys the browser usability for your users (broken back button, not possible to set bookmarks, etc.). It's possible to work around, but that makes extra work.