Rails link to remote site in a partial pop-up - ruby-on-rails

I want to render a link to an external site in a pop up from my site in Rails. What's the best way to go about doing that?
e.g. I want to have something like www.cnn.com show up in a pop-up partial when a link is clicked on my site.

You can't make cross domain ajax calls to show inside a popup. So it won't be so easy as rendering a link. You can try using a iframe inside that popup.

Related

jquery mobile multi-page internal hyperlinking

This appears to be pretty basic but I can't figure it out.
Using a jqm multipage template, I'm trying to allow users to jump from a link one page (id='page1') directly to an image in another page (id='page2').
FIDDLE
It appears I am constrained, by html hyperlinking rules and jqm, to this:
<a href='#page2'>go to image on p2</a>
... which of course jumps the user to the top of page2.
But that's not what I want. I want the user to jump directly to the IMAGE, which is close to the bottom of page2, tagged like so:
<img id='image-id'>
But tagging the link with the image's id (not the page's id), i.e. tagging it like this
<a href='#image-id'>go to image on p2</a>
doesn't work.
I get the feeling I'm missing something very obvious, but can't figure it out.
Any suggestions? Or is this not possible?
I've got a different problem but found this question in my travels... thought I would add an extract from the jquery mobile page:
http://demos.jquerymobile.com/1.4.5/navigation-linking-pages/
Note: You cannot link to a multipage document with Ajax navigation active because the framework will only load the first page it finds, not the full set of internal pages. In these cases, you must link without Ajax (see next section) for a full page refresh to prevent potential hash collisions. There is currently a subpage plugin that makes it possible to load in multi-page documents.

I want to add facebook like button on a page in my website, but have the URL go to a totally different page in my website. Is it possible to do this?

I want to add facebook like button on a page in my website, but have the URL go to a totally different page in my website that has more detail. Is it possible to do this?
Yes, you can add a "data-href" attribute to the fb-like div, like so:
<div class="fb-like" data-href="http://www.DOMAIN.com/PATH/TO/MORE/DETAILED/PAGE" data-send="true" data-width="450" data-show-faces="true"></div>
Documentation found here

How to update iframe page tab content using a form?

I am trying to pass data using a form to a Facebook iFrame page tab but can't seem to figure how to do it.
I have a page tab on my Facebook page with several elements such as links and images directing users to various pages on the main website. This is updated every week, so rather than update the HTML file and upload via FTP everyweek i would like to see if i can create a form to pass the new data to the iframe.
In addition the Facebook page tab cannot be created in PHP as the server is running ASP.NET
I am trying to do this without the use of a database table if possible, using POST or GET would be preferable.
If anyone knows of any tutorials or has any tips i would be very grateful.
Cheers
You can only pass content or interact with iframe content if it's on the same domain as the parent webpage that has the iframe. All browsers have a "same origin policy" that prevent you from being able to do that - sorry :(

How can i do like the Pinterest unique modal process?

I have a question that
Point> I don't want to know generally function of modal, but like Pinterest
Question core > 1. Can i change the URL when i use ajax without "reloading"
Work flow >
1) On Pinterest, i click on a image
2) A modal window opens up, but the URL of the page also changes without "reloading"
even though it use ajax
I've known that when i using a modal function, it dosen't change the URL on the page,
but not on Pinterest
URL change e.x) rootURL -> otherURL
3) I click the background of the modal, the URL of the page also changes without "reloading"
and modal windows closed
URL change e.x) otherURL -> rootURL
So, If you have some solution or information, please let me know that.
Also I have red related question answers, but it's not enough. and don't want to get information obout HTML5 API cause i'm not going to provide HTML5 service
How can I duplicate Pinterest website's modal effect?
Pinterest like ajax loading
Changing the Url without a HTML call
Manage in the same url the Full HTML document and a JSON object (or a partial HTML response)
you can do like this http://mazzimo-in-london-eng.blogspot.com/2013/01/the-pinterest-url-sorcery-how-pinterest.html

Issues with jQuery Mobile $.mobile.changePage function

I am using $.mobile.changePage() to change move from a login page to a home page. From there, none of the links on the home page work. Those links are all using the standard href link. I tried just using an href="" link for the login button as well and that works but the problem is, once the login button is clicked, I need to do some sort of login process to make sure that they entered in the right stuff and as far as I know, the href just happens immediately and I cannot make it wait or stop all together. I tried using the event.preventDefault() but that would not stop the href from switching the page before the login checking was done. Anyone have any ideas on how to solve my situation? I am pretty new to jQuery Mobile so I dont fully understand every detail about it yet. Also I am working with some legacy code at the moment and that code uses jQuery mobile alpha 4.1.
How are you checking for the data from the login page? If you are only using javascript, you could just add an onClick() handler on the login button, and get the values from the fields with document.getElementByID(). AFTER that you could do $.mobile.changePage().
Or maybe I don't understand what you are trying to do.

Resources