Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7494997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:54:39+00:00 2026-05-29T17:54:39+00:00

I’m working on an inherited unfinished application that was using some prototype features for

  • 0

I’m working on an inherited unfinished application that was using some prototype features for ajax calls, then I used JQuery for other purposes. At a certain moment I had an incompatibilty issue that I solved using the jQuery $.noConflict() option so I kept the prototype thing as everything was working smoothly on all browsers… except for the day when I tried to test it on IE (version 8). It kept displaying a stack overflow error and the application was not reacting properly. I did change the header by adding <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> just in case but after some research it seems that the problem is caused by the improper handling of the prototype library by IE. So instead I decided to switch everything to Jquery. The only remaining piece of code that uses prototype is the following :

function ajaxAll() {
$('pro_search_form').onsubmit = function () {
    initornot();
    inline_results();
    putmks();
    return false;
}
}

function initornot() {
var $elem = $('conteneur');
if($elem.getStyle('display') == 'none') { setTimeout("init();", 77); }
else init();
}

function inline_results() {
new Ajax.Updater ('pro_description_div', base_url+'main/ajaxsearch', 
{
method:'post', 
postBody:'magasin=true&ltype='+$F('ltype')+'&lieu='+$F('lieu')+'&keywords='+$F('keywords')
});
new Effect.Appear('conteneur', {duration: 2.0});
}

function putmks()
{
var url = base_url+'main/prosearch';
var myAjax = new Ajax.Request(
  url,
  {
    method: 'post',
postBody:'magasin=true&ltype='+$F('ltype')+'&lieu='+$F('lieu')+'&keywords='+$F('keywords')
  });
}

Any idea on how to transform it so I can get the same behavior using JQuery syntax?

Basically the first function ajaxAll() catches the submit action of a form (pro_search_form) then calls the function inline_results() to update a div with an appear effect using the post method for the ajax call and the function putmks() that would basically eval the returned javascript content generated by the controller at the url ‘main/prosearch’ after send the same post data parameters (this function is the most critical part as it takes advantage of prototype ability to automatically eval any javascript as long as it has the proper header text/javascript).
The third function initornot() is just checking the display property of a div before taking an action.

N.B: used Prototype version is 1.5.0 and Jquery is 1.7.1

Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T17:54:47+00:00Added an answer on May 29, 2026 at 5:54 pm

    Yup I finally got it done with the following code improved a little bit:

    $(document).ready(function(){
    
    $("#pro_search_form").submit(function(e) {
    
        allResults();
    e.preventDefault();
    
     });
    
    function allResults() {
    
    $.post(base_url+"main/ajaxsearch", {'magasin':true, 'ltype':$("#ltype").val(), 'lieu':$("#lieu").val(), 'keywords':$("#keywords").val()}, function(results){
        $("#pro_description_div").html(results);
        $("#conteneur").fadeIn("slow");
    });
    
    var elem = $("#conteneur").css("display");
    if (elem == 'none') { setTimeout("init()", 84); }
    else {init();}
    
    $.post(base_url+"main/prosearch", {'magasin':true, 'ltype':$("#ltype").val(), 'lieu':$("#lieu").val(), 'keywords':$("#keywords").val()}, function(results){
        val(results);
    });
      }
    
    })
    

    I know, I’m answering my own question, but I just wanted to put the solution available for other folks in case they come across my question.

    Thanks prodigitalson for the advice 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am reading a book about Javascript and jQuery and using one of the
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.