Ajax requests in jquery mobile dialog - ajax

I have a problem...
I'm working on a dialog in which there're two buttons that are linked with two different actions.
I'd like to have two Ajax requests when the buttons are clicked.
I tried every kind of javascript scripts but it dosn't work...
I premise that in the page of the dialog I haven't included jquery mobile scripts (in the guide is said that dialogs don't need links to the script if they're called as dialogs through a link [data-rel])
It seems that inside dialog external javascript code isn't loaded...
This is a problem...
Do you think it's better to call the dialog with a simple link (without data-rel and with data-ajax=false) and replace data-role=page with data-role=dialog (I mean inside the dialog page).
Thank you
Best regards
Luca

I found the solution through Jquery mobile forum...
The problem is that for dialogs the javascript code must be wrote inside the page div and not at the end of the body (the classical position of javascript code).
So your code will be loaded and will work...

Related

CKEditor multiple iframe dialog fields show the same dialog

I have created two CKEditor plugins. Each of them uses an "Iframe Dialog Field", meaning that a dialog box is launched and the contents of that dialog box is a webpage (you can think of the entire dialog box as being like one big iframe).
Each plugin works perfectly on its own. However if I use both plugins in the same CKEditor app, they both end up displaying the same page, rather than two different pages, despite the fact that they point to two different pages. I see no reason why this should be happening. Does anyone know how to prevent this?
To make sure there is no confusion, an "IFrame Dialog Field" is a dialog box whose contents are another webpage.
Documenentation - http://ckeditor.com/addon/iframedialog
[ This is different from using an "IFrame dialog", which I believe is a plugin that lets the user add an iframe to the page.
Documentation - IFrame Dialog: http://ckeditor.com/addon/iframe ]
In terms of usage, when using an IFrame Dialog Field, you specify the url of the page to load in the addIframe() command. Here is an example of using a CKEditor Iframe dialog
https://gist.github.com/garryyao/1170303
Back to my issue - if I use just one of the plugins in my CKEditor, it works perfectly. Each plugin points at a different url, and opens that url as the contents of the dialog box. But, if I use both plugins in my CKEditor, although I see a different icon for each, both end up launching a dialog box which points to the same url. Depending which one I launch first, that is the url both end up opening. It is as if you are only allowed to use one IFrame Dialog Field in CKEditor, and the first one used overwrites all others.
This same question was asked a couple of years ago, with no response on the CKEditor forum. The person who asked the question posted his solution, or rather his workaround, which was to NOT use the IFrame Dialog Field altogether, but to instead use a regular dialog and then put an iframe element within it.
http://ckeditor.com/forums/CKEditor-3.x/multiple-iframedialog-plugins-display-same-dialog
That seems like an OK workaround, but it is a workaround and not a solution. I haven't tried it yet, and don't know what potential issues I will run into if I go down that route. I'd prefer to fix my existing code rather than rewrite the plugins, unless I have no choice.
Any help would be appreciated.
Since I have not found any further information, or received any answers here, I ended up going with the workaround mentioned at the end of my question - I used a regular dialogue box and put a big Iframe within it. This problem doesn't exist with that approach, and It looks pretty much the same as an Iframe dialog box. (Considering the almost total lack of community support with CKEditor customization, I've realized it is better to just adjust your design/concept to do what is more easily accomplished with CKEditor, rather than get CKeditor to do exactly what you want).

Bootstrap Modal Ajax not working on click

Bootstrap Modal Ajax not working on click without the alert on second line.
please help
http://pastebin.com/cyXdWSPq
Try wrapping your code in a $(document).ready(function(){}) or equivalent. When I see stuff like this it's usually because the document is not fully loaded yet. Give it a shot.

N2CMS: how to add popup conent

I have a news-type website that I am looking to create using N2CMS, but besides the regular operations (being able to see a calendar, viewing lists of news, viewing news details etc.), part of the content in the website is displayed in "modal" popups (similar to the ModalPopupExtender from the AjaxToolkit) inside the page (for example if you click Login, a popup panel appears with the login controls).
My question is: is there a way of adding a handler for a link, and displaying a "modal" popup when the link is clicked? If so, can this be done from the template GUI editor (and how)?
Thank you
N2CMS doesn't have any built-in handlers to create modal pop-ups for links. However, N2CMS does ship with the Jquery JavaScript library. My suggestion would be to use JavaScript in your site template to select and format the desired links with modal dialogs -- but that can't be done from the GUI editor, you'd need to do it in the template code directly.

Ajax permalink in wordpress Pluto Theme

Having an issue with a wp theme and creator can't seem to help. It's Ajax driven and doesn’t support custom permalink...
So as soon as the website appeared on Google all link referred send to some black page which seem to be out of the website:
Link appearing in Google: www.thaiorchid.be/menus/ (black page)
Compared to the real webpage: www.thaiorchid.be/#menu-item-21
I start to have an idea of solution with: AJAX navigation in Wordpress - Trouble with Permalinks and tried it on the contact page www.thaiorchid.be/contact which doesn't redirect to the black page anymore but it's still not perfect compared to www.thaiorchid.be/#menu-item-19...
Any idea would be really welcome.
Thanks a lot,
Jonathan
Your site does not provide an appropriate fallback for non–JS browsers (e.g. most Google bots to my knowledge). This seems a (serious) shortcoming of the theme without knowing it any further.
If built properly, an “AJAX–enhanced” site like this should allow access to all content through basic HTML requests. If Javascript is available in a client, preferably the same content should be loaded using AJAX requests, allowing e.g. for faster page loads and nice transitions.
Another problem comes from a missing sub navigation. Since your sub menu (fly-out) is not available without Javascript, you would need to provide an alternative way to reach pages two levels deep and deeper.
Here's an example on how this page could/should work without Javascript:
1. Visit homepage
2. Click “Menus” in navigation
3. Opens “Menus” page, showing what the “black page” currently shows
+ proper header/footer
+ main navigation
+ sub navigation for all elements in “Menus” fly–out (“Potages, Entrées, …”)
4. Click “Potages”
5. View “Potages” page, again with proper
header/footer
+ main navigation
+ sub navigation for all elements in “Menus” fly–out
I know, you’re looking probably for a quick solution, maybe a snippet of code or a plugin to resolve your situation. Unfortunately — unless your theme provides you with some help — such a silver bullet doesn’t exist. The current implementation simply approaches the topic of an “AJAX site” in a fairly reckless way IMHO (you will be “happy” to know, that most screen readers won’t be able to access your content either) and until you re–build the theme or fix the structure you’re pretty much stuck with an unaccessible site.

Modal popup in Classic ASP?

I write in .NET and in classic ASP.
I want to create a modal popup in ASP, like in .NET how the parent page can be disabled and turned a different color.
Is this possible in ASP?
Or is there no easy solution to get this done?
If possible...how?
You're going to use Javascript to make something like that, I'd recommend you use jQuery. There is a lot of prebuilt libraries to help you do that.
For the modal box, you might start with the jQuery Dialog.
Just use a javascript library to do this. jQuery is a popular choice and there a number of plugins to do this.
jqModal
thickbox
Yes, of course, but if you are writing the Javascript yourself, you can just create a hidden DIV tag that has the same exact page rendered, but with a 15% gray - transparent .gif file that sits on top of what is displayed. Then you change that DIV tag to visable when the Modal dialog is launched, and change it back when it's closed. Simple.
There are some great JS libraries out there that can help you.
I like jQuery and YUI for their ease of use.
Try this link and look around at some of their Panel offerings.. all of which have a Modal setting that will grey out the background.
http://developer.yahoo.com/yui/examples/container/panel-loading.html
Good Luck~
" how the parent page can be disabled and turned a different color"
You can use the ibox javascript, I have used it with good results.
http://www.ibegin.com/labs/ibox/
I'd put a vote in for stickywin from the clientcide site. Its all Mootools bases and very sweet to use.

Resources