i have check about this question. But still stuck, I am using wordpress and want to insert it in some page or post.
So i have searched and see this code http://jsfiddle.net/akhurshid/NuwE6/ but when i transfer to html or insert in http://liveweave.com/8PQ77Q and nothing happen?
Any idea?
Thanks for your help
You probably don't have jQuery included in your page. For instance, on LiveWeave, you need to add jQuery as a library to see your code working. Just check you have jQuery loaded on your Wordpress website.
Related
I have a blog page that uses ajax to call different article from PHP files once the relevant link is clicked. The problem is that when the PHP loads the Facebook plug-ins don't work. If I open the PHP files using the URL directly in the address bar on the browser then they work fine. I am including links to my page so that you can see it in action. If you replace blog.html with blog1.php you will see what I mean. I would really appreciate any help. Thanks. http://www.tagwebsites.com.au/blog.html
I managed to sort this out with the help of Facebook. The issue was as simple as adding the BFML tag to the html tag at the top of each page. It works great now. Thank you to everyone that sent messages through. I really appreciate your help.
I have been working on ajax for quite a while. I know about the hashtag and hashbang. Recently I have started using Code Igniter framework. Lets say I am in a page - http://domain.com/media, and there is a link called 'audio'.
When I click on this audio link, I send an ajax request, fetch the contents and display the content dynamically. But in such case the URL still remains the same (i.e.,) http://domain.com/media.
Now, is it possible to change the url to http://domain.com/media/audio when I click on the audio link and I still want to have the ajax functionality. I dont want to do it the usual way of the code-igniter (/controller/method).
Any help would be appreciated. Thanks in advance.
If it is not possible in Code Igniter, is it possible in any other framework?
You can use the pushState to achieve this.
Here's an example of my own site using it for browsing given images; no reloading occurs. I've also added support for each gallery image and it's loaded url, so that you can share the url with anyone without problems. The fallback is that if pushState is not supported, you will simply browse as you always do.
I am wordpress and i am writing php or mysql code in a post but finally when i hit publish it gives an Server Error : 500 , i also trying putting my code under [code] [/code] tags nothing happened but when i remove my codes and hit publish then it's working
Any idea guys
Waiting for help
PHP code in the post? Can you use page instead of post? If yes, you could assing custom template for the page and execute code in it(I mean template). If no, try this http://wordpress.org/extend/plugins/exec-php/
if you visit here: Example You will see my problem.
The page loads, then loads all the same content within a div id=content
Have a look at the source for the JS/jQuery and if you need the PHP just let me know. Im not too sure if its the JS or PHP that's doing this. I use the jQuery Address Plugin so maybe im not using it properly but this is killing me.
any ideas on what i could be doing wrong? in Firebug the page loads and simply doesn't stop. Try it out if you have it.
Any help is appreciated!!
This line of code:
$('.content').load('http://laynestaley.co.uk/test/'+fragment+'?ajax=1');
Is actually loading the entire page into <div class='content'></div>. Your server-side code must not be executing the way you expect it to with that AJAX call (It's just loading the index page of /test/ again).
I agree with #Andrew, but just a suggestion -- if you don't want the page to "snap" when the AJAX is loaded, set your height in css to something like 100%
You are incorrectly building fragment. In you code first letter truncated in query.
Correct code:
fragment = event.value.substring(2);
I am very new to WordPress, so I would appreciate some help.
I am using WordPress as a CMS, and I am trying to make the thing work so that when I select a page to edit, there is a special box where I can input PHP code that will execute on my page.
I have found the PHP exec plugin, which works perfectly, but I would like to keep the code out of my main text editor, out of the way of my client's careless fingers.
Any suggestions would be very, very appreciated. Thanks!
You could create a template for each one, and include your PHP there.
Simply select the template from the page edit page.
But if you are only including a little PHP per page, you could get the slug via WordPress in your page template and act on it accordingly.
You can also add an extra meta box on the post editor page, only visible to you, with a textarea where you can add the code. You would save it as a meta field of the post. Your template can check for the existence of this field, and execute it if found.
PHP Exec is the best plugin I have found, and I looked long and hard for that one. The problem with doing it as you suggest is that if the PHP code displays an item on the page, it still has to be formatted within the page as well. It is a simple logistical problem, but somewhat of a complex coding problem. I haven't been able to get around to working on creating a better plugin for it.