javascript:q=location.href;p=document.title;void(open('http://example.page/links/bookmarklet_new?
link%5Burl%5D='+encodeURIComponent(q)+'&link%5Btitle%5D='+encodeURIComponent(p),'Page','toolbar=no,width=700,height=350'));
Im using Bookmarklet script like above. But in case if user is not logged he is redirected to root_path. But then I would like to scroll or center page to login form. I tried override styles. But how to check when page is open in popup window?
Have your bookmarklet add a query string parameter like &view=popup, then the page you open can check the query parameter and change the HTML or CSS as necessary. If your page redirects, make sure it checks for the view parameter and passes it to the next page.
Another option for showing the correct part of the page within the window is to use a hash and a fragment identifier in the url. For example #loginform.
Related
I am developing a website and having trouble figuring out what I can use to accomplish this requirement.
I need a website where links in the document load the contents of page that was clicked.
I am thinking about using angular.js but how might a user get back to the back by entering it into the url.
Example of what I am looking for:
You are on www.example.com
You click the link to www.example.com/profile/1234.
The page doesn't reload but loads the contents of the new page.
The static element at the bottom of the page doesn't change the the rest of the page does.
The url has also changed and you have the history of being at www.example.com
You can also load the exact same page by pasting the url www.example.com/profile/1234, it also has the same bar at the bottom.
You could also say I need something similar to youtubes website. You click a link and it loads only some of the page. But if you re-enter the url you get all of the page.
Thanks.
Ok, I do not have code for this so I would need assistance here. I have a page that has multiple tabs worth of information. If I proceed to an entirely new page (URL) and then hit back on the browser, is there a way to land back on the tab I left off of?
when you click on a tab you can append a url parameter e.g. ?tab=tab1. And when you load the page you can check you're url parameters and default to that tab if it is in the parameter.
Here's an example that's similar. When you click on the toolbar on the left on bootstrap's getting started page it appends that item to the url. so when i click on 'support' the url looks like http://getbootstrap.com/getting-started/#support and when you go to that url it automatically scrolls you to that section on the page.
I am working on an HTML website where I have 4 divs in an index.html page.
Earlier on clicking the div section used to expand it and the other section became smaller in width.
Then the client asked to make sure that the URL was changed when we click any of the div.
Suppose we click the div called test. The page url shoul become /test.html, without the page reloading. I have implemented this functionality using the history API.
Now when I click on the test div and the url becomes /test.html and then if I click a link, it redirects to another page.
From this page, if I click on the browser back button, then it takes me to /test.html which does not exist and we get a 404 error.
I tried making a redirection page called test.html which redirects back to the index.html page, but we get a blink while doing so.
What I want to ask is whether there is a solution for this problem?
If you have mod_rewrite enabled on the web server, you could set this up as a URL rewrite rule.
RewriteEngine On
RewriteRule ^test.html originalfile.html [NC]
This will redirect test.html to the original html file when the user presses the back button and navigates to test.html while the browser address bar still displays test.html. From here, you should be able to detect the address in javascript and display the appropriate div.
(Note that you will probably need to modify the above rewrite rules depending on how your server is configured. For more information about creating rewrite rules, see this link.
I need to build Google Chrome plugin, what will track all clicks on all links on all pages.
After click on link, instead of page opening plugin must catch click, plugin must obtain href attribute of the clicked link, change something in this URL and open page with new, changed URL.
Is it possible to make?
With the Content Scripts you can pass your own JS library into any (or particular) page, intersect clicks and prevent defaults (with regular JS API) and finally you can pass link back to the background page and use chrome.tabs API to open the window.
Actually i have a asp:LinkButton in aspx page and i just want that whenever user clicks on asp:LinkButton open popup on dat asp:LinkButton its already done and i have given another link to it(its ur website's link only) and its working fine,
but the problem is now i want to open a popup with checkboxes with the cities name.
i have made one type of you can say block in a DIV on the same aspx page in the bottom and now i want is to call this div content in the script above in windows.open..
Please help me out ..
asap
Thank You!
You can't show only piece of the current page using the window.open function - only the whole page.
Use ModulPopup from the AjaxControlToolkit or Dialog from the jQuery-UI or some similar functionality.
Or you can create new page that will contain only div with cities names checkboxes and open it via the window.open function