Facebook comment using ajax/django site - ajax

I have just one trouble adding fb comments box in my site. I use kust one url and read the content of the site using js. I put in the head the init of my fb app but I have three post in the main page and I want one comment box for every post. To load the comments of my post I use ((myurl)){{post.id}} to make unique the comment box. This url dosen't exist. But show me up difference comment for every. But don't let me moderate.. I mean dont show the moderation tool. But if i change the href of the post to my url real. Show me the noderstion tool but the same comments in every posts. Any idea???

The page is by ajax bwcause is a radio station and need to listwn the station y all contwnt. There is any way to assign thw url "manualy" in thw api of fb?

Related

Magento Anchor Tags

I have a list of FAQ links on my home page in a static block in the footer. Each link however just opens up the FAQ page.
My code sample
What is Individually Quick Frozen?</li>
What I want is that when a user clicks a particular link in the list on the homepage footer under FAQs (as above), the user should be directly be taken to the answer of that question on the FAQ page i.e. the page should scroll down to where the questions is answered.
My Code sample
<p><strong><a id="1">What is Individually Quick Frozen?</a></strong></p>
But no joy! what am I doing wrong?
Make your link look like this:
What is Individually Quick Frozen?</li>
or better yet
What is Individually Quick Frozen?</li>
Note: For Cms pages urls use direct_url as a parameter for the {{store}} directive. It avoids having a / at the end of the URL. Useful if your pages end with .html. It's not your case but it may be useful in the future.
Now your code in the cms page should looks like this:
<p><strong><a id="_1">What is Individually Quick Frozen?</a></strong></p>
Avoid using numerical ids for elements. It's not standard
Worked perfectly, be sure to update
<a href="{{store url="faqs"}}#_1">
"faqs" to what ever page you want your tag to land on though.

Wordpress Filter by Tag with Ajax

I'm setting up a P2 themed (using Houston child theme) Wordpress. I want to accomplish the following but after hours and hours of searching I cannot figure out how to do this even though it seems like something that would be common.
Ideally, I would like a tag list in the sidebar with checkboxes for each tag. Only posts that match checked tags are displayed and it updates with Ajax rather than a page reload. It saves what you have checked to the user profile (page will require login).
I would settle for simply having a tag list/cloud that would update with Ajax if I could also have links that would display multiple tags. It's no problem if I have to hard code these tag-grouping links.
Basically I want users to control what posts they are interested in reading, the assumption is no one will be reading every post, just the tags that pertain to them.
The best I was able to find was this plugin:
Cat + Tag Filter
http://wordpress.org/extend/plugins/cat-tag-filter-widget/
And configuring it for checkboxes on tag. It doesn't reload with Ajax or remember what the user selected, but it does take you to a tag filtered page that you could bookmark.

Tumblr: how do I remove the description/sidebar box on the submit page in the default Peter Vidani theme?

I have a tumblr account that has submission enabled, and I have a short description with a form in the "description" area that appears on the sidebar. However, this description also appears on myblog.tumblr.com/submit. I'd like to remove it.
I looked at the documentation on http://www.tumblr.com/docs/en/custom_themes#navigation, but haven't been able to figure out how to prevent the sidebar description from showing at the top of the submit page.
Can anyone help?
I'm not sure if I understood your question correctly. But if I did, a work around would be using jQuery to check if the current url contains the string /submit and simply disable the sidebar, or the element that contains the description.
I don't know jQuery but I know it's possible. I'd suggest you to look into this post:
How to check if the URL contains a given string?
and combine it with this line (replace the "alert part")
$("#sidebardescription).hide();
Another solution would be if Tumblr provided you with a way to only render for specific pages. They usually do that. I'd look into this part {block:SubmissionsEnabled} {/block:SubmissionsEnabled} before I go with the workaround.

"facebook comment id" added to url - inconveniently

A user comments on the page, the comment is posted to their facebook wall. When another facebook user clicks the link to see the comment it links back to the page but with a massive string of numbers on the end.
http://canofclouds.com/thought/?fb_comment_id=fbc_10150505683457013_20914817_10150507783662013#55
The original url was: http://www.canofclouds.com/thought/#55
This is all fine so far though, until the user clicks a button to go to
http://www.canofclouds.com/thought/#56
Instead, it goes to:
http://canofclouds.com/thought/?fb_comment_id=fbc_10150505683457013_20914817_10150507783662013#f25e670a6c
Which is not good - because it doesn't exist. Ideally it would just go to http://www.canofclouds.com/thought/#56
Normally, when the user clicks the next button a flurry of javascript grabs the hash key (in this case #55) then adds 1 to it (to make #56 - yay) and executes an ajax call to grab the new content. This facebook stuff is making things a little complicated though.
Any ideas?
Edit: Even more ideally i could disable the 'fb comments id' altogether.
You shouldn't use hash keys to link to your page. You should use a canonical URL to do so.
There are a few questions here on stack overflow about how to deal with this.
The only way around it if you choose not to make canonical urls, is to do URL Rewriting at the network or web server level.

Ajax - How to change URL by content

I'll explain:
I have a picture gallery, the first page is display.php.
Users can flip through pictures using arrows, when you click an arrow it sends an Ajax request to retrieve the next picture from the db. Now I want the URL to change according to the picture displayed.
So if the first picture is:
www.mydomain.com/display.php?picture=Paris at night
I'll flip to the next one and the URL would be
www.mydomain.com/display.php?picture=The Big Ben
How do I do this?
The trick here are uri's with an anchor fragment.
The part before '#' points to a resource on the internet, and after normally designates to a anchor on the page.
The browser does not refresh if the resource is the same but moves to the anchors position when present.
This way you can keep the convenience of browser history from a usability point of view while replacing certain parts on the page with ajax for a fast and responsive user interface.
Using a plugin like jQuery history (as suggested by others) is really easy: you decorate certain elements with a rel attribute by which the plugin takes care of the rest.
Also kinda related to this topic is something called 'hijax', and it's something I really like.
This means generating html just like you would in the old days before ajax. Then you hijack certain behavior like links and request the content with ajax, only replacing the necessary parts. This in combination with the above technique allows really SEO friendly and accessible webpages.
You can use the jQuery history plugin for example.
changing the search of the url will load the changed url.
See also: stackoverflow, javascript changing the get parameter without redirecting
Do you really want to use AJAX here?
A traditional web request would work like this...
User navigates to display.php
User clicks "next" and location is updated to "display.php?picture=Big-Ben"
Big Ben is shown to user, along with a link to "display.php?picture=Parliment"
User clicks "next" and location is updated to "display.php?picture=Parliment"
And so on.
With AJAX, you essentially replace the GET with a "behind the scenes" GET, that just replaces a portion of your page. You would do this to make things faster... for example...
User navigates to display.php
User clicks "next" and the next image location is obtained using an AJAX request
The image (and image description) is changed to the next image
What you are suggesting is that you retrieve the "next url" using AJAX and then also perform a GET on the whole page. You would be much better off sending the "next" image when you send each page and not using AJAX at all.
this best describes everything i think: http://ajaxpatterns.org/Unique_URLs

Resources