Facebook appends query string to liked pages - string

When you like a page on Facebook the link to the page now appears on the users news feed with a query string appended to the end e.g
?fb_action_ids=102187656601495&fb_action_types=og.likes&fb_source=aggregation&fb_aggregation_id=46965925417
This 404s on every single page on my site.
I can change the facebook 'data-href' parameter on all my pages so the link will work by appending my own query string (?opendocument - the site is in lotus domino)
This works but means losing all the likes already in place on the page and effectively returning to zero likes for all the pages.
Is there anyway I can stop facebook appending the query string? If not can I update the 'data-href' paramater on my pages but still maintain the like count already in place.
Many Thanks in advance for any guidance here
Pete

Related

ViewPath query parameter in SharePoint list causes CSOM to fail Lists.GetById

It seems due to a recent SharePoint Online update that their lists (when selected using the left navigation) now adds a ViewPath query parameter by default. With this change, it seems like the Provider Hosted App redirect now sends a different ListId and not the Id for the actual list. When I use CSOM to resolve the ListId it results in a "Site Pages" and not the list at all.
clientContext.Web.Lists.GetById(ListId);
This code base did work before the recent SharePoint Online update but now I cannot call my list. If I manually remove the ViewPath query parameter from the list then the redirect shows the correct ListId and CSOM resolves the correct List. The problem is I cannot expect users to manually remove that query parameter.
If I navigate to the list by using the Site Content page and not the left navigation then this query parameter is not present and my application works.
Does anyone have context or direction into how to handle this new change?
I have a similar issue on our site. Instead of modifying the list, a script web part on the initial page seems to bleed through. I have ammended the links in the lefthand nav bar in an attempt to circumvent the viewpath query being added. I put in 2 url carriage returns on the end of the link. So far so good for me.

How to keep data on XSP page while calling history.back()?

I have a page, that is a search form (lets say - search.xsp). If document are found, multiple links are generated to document links (item.xsp).
I would like to keep search preferences in case user uses "back" button, so I can serve him with last searched data by him.
There is context.redirectToPrevious() method, but I can't use it because of on-load redirect.
So, how can I achieve that? Any help will be appreciated.
can't you store the search queries made in a sessionscope so you have them available when the user hits the back button? you can check the available values via the debug toolbar

when startKey is unknown how to implement strategy for couchdb/pouchDb

Numerous readings indicate that skip should REALLY be avoided when doing pagination. As in the link most cite that using startKey and limit is the way to go. After I get the first page I know the startKey of that page, the lastKey of that page and the total entries. If I have a pagination control with page numbers as buttons and the user selects page 3, how do I get there? I have no idea what the startKey of page3. Perhaps, I do a simple view up front to go get the start keys for the each page.
This page nicely describes pagination:
http://docs.couchdb.org/en/1.6.1/couchapp/views/pagination.html
So, you can't really have a "Go to page 298", but to have links to the previous and next 5 pages, you can look up a larger number of preceeding and following documents and generate links accordingly. For example, if you have 10 posts per page, look up 50 following keys and take every 10th one.
As for making a "Go to page X", perhaps a background script that generates somesort of cache?

Take data from query string and put into another form value (for both display and posting)

With that said, there is a question that seems to be asked a lot and has answers - but I'm not a programmer 'enough' to understand all the different explanations. I was hoping for something more clear and concise to my very specific example and need.
I have two forms. (I might also add this is being used on Wordpress)
One form is on the first page and will collect age, home value, and debt owed - all in drop down select fields.
The second form is on the next page and will collect other contact information and upon submit - will post all the fields to my CRM.
I have been able to successfully get the data from the first form into a query string on the page of the second form. But try as I might - I just can't figure out how to get the field data from the query string into my field forms. (Both display or pre-populated and as a value ready to be submitted once the rest of the fields are completed.)
Here is an actual query string:
http://example.com/2-form-test-2-of-2/?age=75&value=572%2C500&lien=107%2C500&sendbutton=#.UYSBEKKG2So
I simply need to get "age" - "value" and "lien" from that query string showing in the fields on the 2nd page. Simple is best - even if it's 'hack-ish' as I will most likely just include the code directly on the Wordpress page that includes this form.
One possible solution is to add a piece of javascript that gets fired on page load and:
1) disables form post button
2) populates form fields with values from URL
3) enables form post button
If these values are just suggestions for user, which he could easily change before posting — this should work.
If, on the other hand, these values are internal and unchangeable by user, you should not expose these in editable form and allow user to change those by editing URL or form posting (but including these as read-only page fragments is apparently ok).
This is place for only programmers. To become a programmer, please refer some online resources and ebooks. without knowing basic concepts, you can't understand anything.
even after understanding basics, if you have doubts, you can ask here, providing the code samples you have developed.

Google-Analytics API to track Site Search?

So there's this nifty _trackPageview() api method on a tracker object, but is there a corresponding method that can be used to manually track a search? In other words, _trackPageview() reports to GA that a user hit a page. I want something like _trackSearch("terms") that would report to GA that a user searched for something.
Though not exactly what I was looking for, it seems that one can generate virtual page views to track search results programatically.
Suppose that you've set up a Site Search parameter called "q", so that when a URI is tracked that contains q=these+are+some+terms, GA will mark it as a search hit. One can use the _trackPageview() method to generate virtual search hits like so:
pageTracker._trackPageview('/custom/search?q=These+are+some+terms')
I pass search parameters by GET, so the URL for a search on "TEST" is
http://www.example.com/search?q=TEST
Selecting Content -> Site Search from my analytics account gives me a list of all keywords searched.
To learn more, check the documentation, especially the How do I set up Site Search for my profile? page.

Resources