Let DataTables pagination be proper links - javascript

I would like the pagination buttons in DataTables to be proper links (having an href attribute). This makes it possible to open a specific page in a separate tab by right-clicking on the pagination button, which sometimes is very useful. It also makes it easy to get the correct url for each page, making it possible to send the url to a specific page to a friend.
Clicking the pagination buttons should of course not navigate to the url, but load the page's content via ajax, as it already does. The server side already supports delivering the contents for a specific page, so that pagination also works for users with javascript disabled. So the only thing I need is some way to tell DataTables the url to add to each of the pagination buttons. Is there any way to do this?

Related

Can we intercept JavaScript in Webview?

I am loading external website into the webview. On one of its pages, there is a button which shows/hides table. The show/hide action is done via JavaScript.
I have not been able to detect this JavaScript no matter which method I override in WebChromeClient. I can detect JavaScript alert popups, but not this code.
I basically want to know when a user has shown this table to I can offer him additional help filling the table.
Can this be done at all?

Keep most HTML after link clicked

Hi i want to make an effect similar to what this site does http://www.hffm.co.uk/
When you change the page the url up top changes but the content in the sidebar and header stays the same. - i am also curious if this affects SEO.
They stay the same - and do not reload with the page - i figure it has to be some ajax thing? Curious what a system like this is called.
The point is in their case they dont want to interrupt the radio on a link change.
To update the specific part of the page it can be achieved through Ajax and JQuery. Basically both of the those works on the client side which means that website doesn't refresh. You can always make a Ajax request to the server which can return the content in a Json format and that content can be reflected on the page using Jquery.
This is only just a overview of how ajax/Jquery works. But you need to be more specific in what you are trying to achieve and what you have done so far.

Share button with different pages

I researche it quite a bit, and thus it seems simple, I couldnt find the answer.
So I have a website that has different articles,each with a custom facebook share button. Every time the user wants to share, I activate javascript sdk and it works. However it shares the opengraph tags that are defined in the header. How would I do that dynamically ? I want to share the specific content of the article ? Is opengraph the right way ?
I assume that your use case is something like the main page in a blog,
where you wish to display several articles in the same page,
and have a like button for each one.
However, the way Facebook crawls your page, it looks at the open graph meta tags for this main page only.
You wish for each of the share buttons to be specific to each post instead.
Have a read of the instructions on this page
In your situation, her is what you will need to do:
Set the data-href attribute of the individual page that the share button is for
For the individual pages, set the open graph meta tags appropriately
This way, when facebook queries your page open graph meta tags, it will not do so on the main page, but instead on the pages you have specified.
Another approach, that will give you more fine grained control, would be to use Facebook's Javascript SDK.
The one that you are looking for, in this case, would be the Share Dialog.
Essentially, here you create your own buttons by hand, and trigger the Facebook Share API using Javascript manually too.

Dynamic pages loading (without realoading whole page) in angular?

I decided to learn AngularJS, but I got stuck on my first project :/
I want to make menu like in first example here: http://tutorialzine.com/2013/08/learn-angularjs-5-examples/ So there are a few options: "home", "projects" etc. and if I click on one I get other part of site without reloading whole page.
What I want to accomplish:
dynamic data loading, when I click on link, refreshes only one part of page not all. I want to make page like this (click on any link - the menu bar sands still and isn't reloaded)
all parts of site are in separate files (I don't want to keep all page data in one html file, I want to break it into pieces)
adress of page (in browsers adress bar) is changing when I click on link
I know I could use AJAX or something like this, but the problem is: I want to make Google-friendly site and - as in know - Google have some problems with AJAX based sites.
Can you tell me what way should I choose and if angularJS actually qualify to this job?

JQUERY UI - tabs - load data into a tab, without using IFRAME - Alternative options

I currently have a JSP page, containing a Jquery UI based accordion (based on left hand side of the page), that in turn when you select an option in this accordion, it launches a new tab (the tabs are based in the centre of the page)
The content that is loaded into my new tab, is from a JSP page that I have within my project. I am doing this with IFRAME, but I wonder if there is a way to load this JSP's data into the tab without it being an IFRAME?
This JSP contains a dynamic data, images and text.
It would be cleaner if it was output displayed within the tab itself and not an IFRAME - the usability for this isn't great.
What alternative options to IFRAME could I have for doing this?
You can use jQuery's load function, it is very simple and easy to use.
A good example of this can be seen here: http://jsfiddle.net/SO_AMK/TR2kn/ (click expand)
A simpler example: http://jsfiddle.net/SO_AMK/TR2kn/1/
But, please be warned that this cannot load data across domains so the data must be on your server (there are some workarounds but they get complicated)!

Categories