Shadowbox with links created via AJAX - javascript

I'm working on a page which already successfully uses Shadowbox.js. There's a search link at the top of the page which looks like this:
Search
This is located in the header.
In the body of the page I can search for a user and load their account information via AJAX. The plan is to add a button to their information table so a system admin can edit it. I'd like to use Shadowbox to bring up a confirmation page once the admin has submitted the edits. I'm using this link to try to do so:
Submit
However, when I click this link, it navigates directly to createPopup.php instead of loading it in a Shadowbox.
Am I supposed to be doing something with Shadowbox in JavaScript so that it plays nicely with links loaded via AJAX?

Related

jQuery script keeps redirecting me from a page I'm trying to edit

I was trying to make an application in SharePoint and wanted to make it so that if you click on a button, it redirects you to a page and when that page loads I wanted it to instantly redirect the user to another page. ( I couldn't get the button to just redirect to the page I wanted on click, so that's why I tried doing it this way. ) I did this using a jQuery / JavaScript script. I'm new to making scripts so I was just testing and I ended up making this script:
<script type="text/javascript">
$(document).ready(function(){
Redirect();
});
function Redirect(){
$(document).load("url");
}
</script>
My problem is now that whenever that page loads, it just loads a blank page. But I can't get to the edit screen because it instantly redirects me to a blank page. I tried turning off JavaScript in Google Chrome but even though I was able to load the page without redirecting, I wasn't able to get to the edit page because it's in a jQuery AJAX drop down menu which obviously also doesn't work if JavaScript is turned off.
I would appreciate any help
EDIT: When I say edit screen I mean the place where I can edit the script. To do that I have to press a button on the page, but I can't do that since the page instantly redirects to a blank page.
Use the webpart maintenance page which allows you to remove and manage web parts without visiting the page, the instructions are as below.
Lets say your page is example.com/sites/default.aspx add the query string ?contents=1 to the page it will take you to the manage web parts page you can remove the script editor web part from there.
The other way is to use SharePoint designer to remove the web part this will also help you achieve the same result.

How do I load a dynamic contact form which has a link in every page in my wordpress website

I have a WordPress website, with a contact form link in all my pages. When clicking the "contact us" link, there should open a div (dynamically) in the center of the page and send the information (dynamically too)...
Correct me if I'm wrong, but including the same HTML code of the undisplayed div with all the Javascript functions will make the load time of my page/s too long.
Is there a way to pull out the HTML only if clicked on the contact from? Maybe getting it from an external HTML file ?
What's the efficient way to do this using WP ?

redirect with javascript without loading the master page

i have an asp.net application under c#
my application consists of master page and its children
in my master page i set a menu
i need when i click on an item in the menu, i need to call a javascript function to redirect to this page without load the master page again.
for example: i am in home page and i want to redirect to contact us page, when i click in the contact us link in the menu, i need to load only the part of the page that not related to the master page.
i know that to load a part of the page i must use jquery, that's why i use jquery to send json request by a web service to a service and get info and represent these info in contact us page.
Problem:
how can redirect from one page to another without loading master page?
Note:
i try ispostback in master page page load method and windows.location = "contactus" in javascript method
any help?
What you are trying to do is not "redirecting" the user, but rather loading content (via AJAX) with which you will replace a certain area of the page with.
Like you said, you'd do that with jQuery;
jQuery("#selectorToGetTheMainNode").load("http://urlToLoadTheHTMLFrom");
This will automatically load and replace the html present within your MainNode with the loaded content.

Facebook share with custom text on button

It used to be done this way:
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<a type="button_count" share_url="http://google.pl" name="fb_share">Share this page on Your's wall</a>
And it used to generate a share button with text "Share this page on Your's wall" instead normal "Share". Since last update it doesnt work anymore.
Is there any posibillity to change the text on share button?
With Facebook JS SDK:
You now have to use the Feed Dialog, which is part of the Facebook JavaScript SDK.
Without Facebook JS SDK:
If you don't want to be bothered with their SDK, you can use this simple link instead:
Share this page on your wall
Here's what it'll look like if you're sharing Google.com with this link:
https://www.facebook.com/dialog/feed?app_id=140586622674265&link=http%3A%2F%2Fgoogle.com&name=Google&redirect_uri=http%3A%2F%2Fs7.addthis.com%2Fstatic%2Fpostshare%2Fc00.html
Also, please acknowledge these three things:
You need to replace [[URL]] and [[TITLE]] with a link to the page you want to share and its title (both url-encoded).
The Feed Dialog has to show from which Facebook app the post comes from. The app_id parameter in the URL above is the one from AddThis. Create a Facebook app and put its own id in the URL to use the name you want instead of "AddThis Sharing". You can keep the app_id from AddThis though, it works just fine.
The last parameter (redirect_uri) is the page where the user will be redirected after sharing. It's currently a page from AddThis with some JavaScript that will close the tab / window. That way, the dialog just disappears when it's not needed anymore. You don't have to change it either, works great.

Reparse Google Plus Button?

I have a website where pages are loaded via AJAX so I reload the Facebook comments box and like button (FB.XFBML.parse()) each time a link is opened. I was wondering if there is a similar way to reload the Google Plus button with JavaScript for a page.
Parsetags should be set to explicit.
See: https://developers.google.com/+/plugins/+1button/
Then you can call gapi.plusone.go(); to have the tags re-parsed.

Categories

Resources