Prototype JS and Imagemapster conflict - prototypejs

I've been working with Imagemapster for about a week and it's been getting the job done. I added Prototype JS this morning and all of my image treatments went away.
If your aren't familiar with either
http://www.outsharked.com/imagemapster/
http://prototypejs.org/
I'm also using jquery-latest.js, Prototype is working fine with or with out Imagemapster. It doesn't seem to matter which order they are loaded in either.
I was hoping there might be another way besides noconflict.
Thank you

Related

Can I conditionally render Livewire components on my page (as one can in Vue)?

I'm attempting to design a project in Laravel. I ran the following command to initialize the project: "laravel new demo --jet". When prompted to choose between inertia and livewire I chose livewire as I've heard better things about it.
A little back story, I'm about 2-3 weeks into learning Laravel and I've never used livewire before, although I am very familiar with using Javascript and am very experienced with Vue.js. I've looked elsewhere for a solution to my problem but now I'm not quite sure if Laravel even supports exactly what I'm looking for.
TL/DR:
I'm wondering what the best practice would be for rendering child components on a page. I would like to create a dashboard that has several options to choose from on the left side of the page. When a user selects an option, I'd like for a corresponding component to appear in the center of the page. If a user were to select a different option, the original child component would disappear and a new corresponding child component would become visible.
Ideally, I'd like to avoid using the router for this, although that might just be because I'm not entirely comfortable with using it. I do understand it's pretty heavily integrated into the Laravel workflow. As I mentioned, I'm used to using Vue where you can easily integrate JS functionality into your html and use conditional statements to hide/show child components without changing routes.
If anything I've said above is causing any confusion, let me know. Thanks.
P.S. If anyone has any good resources for learning livewire & laravel together please let me know about them! Laracasts has been great but I think Laravel recently updated their auth scaffolding and it's causing some confusion for me.

How to handle errors with Laravel and Vue.js

I am just starting to develop an application with Laravel and Vue.js
Currently I have it setup so that Laravel acts like a backend API, while Vue.js renders all of the front-end views. All working well and I am getting the hang of working with a SPA.
One thing I am struggling with. When I was using only Laravel, I was getting the Whoops error handling screen if the were any exceptions being generated on the PHP's end. However since switching over to a SPA, I no longer see the exceptions being thrown (I feel like it something to do with Laravel running on the server, but Vue in the browser, clarification would be amazing though...).
I tried searching the internet for ways to make this happen, most suggested using something like Clockwork or Debugbar. However I don't know if that actually fits the requirements I want.
Whoops was beneficial that it let me see the source of the issue, so I could investigation further, and for someone still learning this was great.
Are there any standard processes that are typically adopted to get the above result? Or is there something I am missing, and as a result I am going about it the wrong way (perhaps there is a reason the exceptions don't get thrown the same way).
Any advice would be really appreciated.
You can use the "network tab" within the browsers developer tools (available in chrome (CTRL + SHIFT + I), firefox, edge etc.) and investigate the detailed response of the request. It is not as pretty as the actual Woops screen (since it heavily relies on JS and nice css formatting) but it usually meets your requirement of being able to track down the actual source of the issue.
Example of chrome dev tool network tab

Looking for a simple, complete, end-to-end, example of using AJAX for a Wordpress LOOP?

Good afternoon,
I have spent a few weeks trying to find a walk through simple enough for me to successfully follow it... it seems like every one i've tried has either omitted information which the author assumed is common knowledge, or been so complicated that I failed to successfully follow it.
I need something very simple, along the lines of simply posting all the needed files (index.php, functions.php, whatever.js, etc) with detailed tagging would be enough.
... I tried following the often-referenced “Getting Loopy”, without success.
I am using a localhost install of WP, which successfully runs the Ajaxify theme and the Ajax Load More plug-in, so I know the failures are all due to my own mistakes in coding :)
my goal is to use a container to deliver the content of an independent LOOP – via AJAX - so that I can use the regular pagination feature of the primary loop elsewhere on the page. Somehow I have failed to find a simple complete example of a fully contained LOOP performed with AJAX :(
any advice is appreciated... I hope this doesn't fall under the “soliciting opinions” clause of stack

how to use IcePush to update client's display?

i'm trying to set an online checkers game, using JSF2 on GlassFish 3, where all the game's logic is taken care by EJB.
the thing is i want player A board's display to get updated after the player B's move. after the player B finished his/her move, i'm calling
pushContext.push("groupName")
on the code's bean (while there's <icecore:push group="groupName" />
tag in the xhtml code)
the problem is (from what it seems to me) player A's board object hasn't been updated from the EJB yet, so there's nothing to update on the display. player A's board display is updated only after he/she finished his/hers move (and at this point its bean code asks for an updated board from the EJB).
i thought i found the solution here. my plan is to set a JS function inside the xhtml, to which the the bean code would call using the <icep:register> tag, and that JS function would call a java function inside the bean code which would ask for an updated board from the EJB and then would update the display.
the thing is i can't find anywhere how to implement any of the 'icep' tags. when i put this tag into my code i get a compile error.
what do i need to add to my project in order for this to work?
or is there a completely different (and better) approach to solve my problem?
cheers,
eRez
The <icep:register> is part of the ICEpush JSP integration, and just intended for JSP pages, not JSF pages. So that may be why you're getting that compilation issue. You can use the javascript registration api. But have you looked at using the PortableRenderer? If you're ejb is in the same jvm, this might work and be a lot easier for you. Check out:
http://wiki.icesoft.org/display/ICE/Ajax+Push+-+APIs#AjaxPush-APIs-PushingfromoutsidetheJSFcontext
Thanks,
Philip

Learning Yii: checking with ajax won't work

I have a small problem that seems to be big enough to hold me from my work.
As I said in the title, I am leaning Yii and after I developped my project, I realized that I don't have ajax check.
I tried to solve this by setting enableAjaxValidation to true and it didn't worked. I tried to make use of the method performAjaxValidation and, again, it didn't worked. The third way was to copy the content of performAjaxValidation and paste it inside my method (like in documentation and identical with the code generated by Yii.
I checked my js and they are loaded.
What could it be? How can I solve this? The problem is that I need my fields to modify while the user is completing the form.
Thank you!
PS: I checked some topics from stackoverflow but the only one who was related was Yii - Ajax Form with validations
Make sure the from that is being validated has the same ID that is being used in the performAjaxValidation function. For example if your form has the id product-form, the if statement should look like this:if(isset($_POST['ajax']) && $_POST['ajax']==='product-form')
If possible I recommend using Firefox with firebug extension so that you can debug whether the AJAX call is even being made, and what is being returned.

Resources