Send a view string to the controller via Ajax. Codeigniter, Javascript and PHP

I'm trying to send information that is in the Javascript code block to my controller, but I'm not sure how to capture the information in my controller.

Here is the javascript code for the view:

Route File:

$route('id_notification') = 'post_notification/insert_id_post_notification';

My controller:

My controller name: post_notification.

I want to enter the ID with the value 1515 in my controller. test score
Thank you very much guys.

Javascript – window.history on dynamic pages with Ajax

I am creating a website that is divided into header and body. The content of the header is never changed dynamically via Ajax, only that of the body. In order for the navigation arrows of the browser to work according to the content exchange via Ajax, I used the history manipulation of the history object using the event onpopstate, My scenario is similar to the example: https://jsfiddle.net/udu3bw38/

The problem is also the same as in this example. If you click the links and use the navigation arrows on the site, the process is normal. However, if you enter another site and then return, the behavior is not the same as if the previous history were no longer there.
I don't have much knowledge about manipulating history with Javascript and couldn't understand it clearly during my research. Could someone explain to me why this happens and how the story works? If possible, a solution to my scenario? Thank you.

ajax – Send information to another page by clicking on a div

Hello friends, I have a question about a new project that I want to implement. I hope that I can explain myself clearly so that you understand what I'm looking for.

I have a file go.php which contains:

    


    CLICK HERE

the other file ladin.php includes:



What does that do if you click in the div class="public" Send a parameter to via Ajax go.php What I'm looking for is that when the go.php page is open, a function is activated when this parameter is received, or in this case a simple one alert(); now the final explanation

the page go.php is a link that opens on another page ladin.php by clicking on the div in ladin.php A parameter is sent to go.php In this case, this should lead to a reaction on the page that is already open go.php, But nothing happened.

magento2 – Slick Slider with Ajax does not work

I try to follow this answer, but it doesn't work perfectly for me

I created a custom phtml & block that shows the product slick slider until the time works perfectly, but after using Ajax the console appears

POST 500 (internal server error)

Here is my identifier.phtml

<div class = "Product packaging Products- ">
  1. <div class = "product article info" data-container = "product"> getImage ($ _ product, $ imageDisplayArea); if ($ pos! = null) { $ position = & # 39; style = "left: & # 39 ;. $ productImage-> getWidth (). & # 39; px; & # 39; , & # 39; top: & # 39; , $ productImage-> getHeight (). & # 39; px; "& # 39 ;; } ?> <a href = "escapeUrl ($ _ product-> getProductUrl ())?> " class = "product photo product item photo" tabindex = "- 1"> toHtml ()?>
    stripTags ($ _ product-> getName (), null, true); ?> <a class = "Product-Article-Link" hrefescapeUrl ($ _ product-> getProductUrl ())?> "> productAttribute ($ _ product, $ _product-> getName (), & # 39; name & # 39;)?> getReviewsSummaryHtml ($ _ product, $ templateType)?> getProductPrice ($ _ product)?> getProductDetailsHtml ($ _ product)?>
    <div class = "product promotions product item promotions"escapeHtmlAttr ($ position): & # 39; & # 39 ;? >> <div class = "actions-primary"escapeHtmlAttr ($ position): & # 39; & # 39 ;? >> isSaleable ()):?> getAddToCartPostParams ($ _ product); ?> <form data-role = "tocart-form" data-product-sku = "escapeHtml ($ _ product-> getSku ())?> " action = "escapeUrl ($ postParams (& # 39; action & # 39;))?> " method = "post"> <input type = "hidden" name = "product" value = ""> <input type = "hidden" name = "" value = ""> getBlockHtml (& # 39; formkey & # 39;)?> <button type = "submit" title = "escapeHtmlAttr (__ (& # 39; Add to Cart & # 39;))?> " class = "Action to perform the primary"> escapeHtml (__ (& # 39; Add to Cart & # 39;))?> isAvailable ()):?>
    escapeHtml (__ (& # 39; in stock & # 39;))?>
    escapeHtml (__ (& # 39; out of stock & # 39;))?>
    <div data-role = "Add to links" class = "Actions-Secondary"escapeHtmlAttr ($ position): & # 39; & # 39 ;? >> getChildBlock (& ​​# 39; addto & # 39;)):?> setProduct ($ _ product) -> getChildHtml ()?>
productAttribute ($ _ product, $ _product-> getShortDescription (), & # 39; short_description & # 39;)?> <a href = "escapeUrl ($ _ product-> getProductUrl ())?> " title = "" class = "action more">escapeHtml (__ (& # 39; More Information & # 39;))?>