关于那些购物网站解决办法
关于那些购物网站
那些购物网站有那种选不同颜色不同size就价钱不同然后显示出来,
用了什么技术?
是ajax吗?
php新手
谢谢
------解决方案--------------------
有些是Ajax异步读取的。。
当点击不同的颜色和尺寸时进行Ajax交互读取新价格。
还有一种是页面加载完成后就载入了全部不同组合的价格。然后选择与页面相匹配的那种商品显示其价格。
当点击不同颜色和尺寸时,切换到你选择的那种商品的价格。
<br />{<br />"qikequanmai":{"name":"奇客花生香酥全麦饼 110克/盒 6盒组合","price":"¥99.00元"},<br />"qikecongxiang":{"name":"奇客葱香全麦饼 110克/盒 6盒组合","price":"¥99.00元"}<br />}<br />
------解决方案--------------------
楼上正解,看你的数据量,如果仅仅几种颜色+尺码同时用户可能来回点,用本地js搞定,不能用ajax占连接,像全国地区数据就ajax吧
------解决方案--------------------
ajax给服务器增加压力本来就不对了,
居然想刷新页面,压力不就更大。
虽然增加一点ajax请求可能看不出来(只要服务器够强就没事)
但做技术的凡事要尽量用最好的解决方案,要有精益求精的工匠精神,这是态度问题!
而且一般精益求精的时候对自己的技术是有帮助的,比如用js做刚好能练习下js。
但是要改很多div的话我觉得是设计问题。
就淘宝商品页面来说,一个商品一般就改个当前颜色的文字和商品图片就行了
介绍页面就不用改了,全部介绍一下。没有改个颜色还要改介绍文字的。
而更新个当前颜色、尺寸,图片,价格 最多5个地方会多吗?
封装个方法,然后把当前颜色大小传进去统一更新页面就行了

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Fujifilm fans were recently very excited at the prospect of the X-T50, since it presented a relaunch of the budget-oriented Fujifilm X-T30 II that had become quite popular in the sub-$1,000 APS-C category. Unfortunately, as the Fujifilm X-T50's launc

Title: Methods and code examples to resolve 403 errors in jQuery AJAX requests. The 403 error refers to a request that the server prohibits access to a resource. This error usually occurs because the request lacks permissions or is rejected by the server. When making jQueryAJAX requests, you sometimes encounter this situation. This article will introduce how to solve this problem and provide code examples. Solution: Check permissions: First ensure that the requested URL address is correct and verify that you have sufficient permissions to access the resource.

TheFiiOCP13cassetteplayerwasannouncedinJanuary.Now,FiiOisexpandingitsportfoliowithtwonewmodels-onewitharedfrontandonewithatransparentfront.Thelatternotonlyperfectlymatchestheretrocharmoftheangulardesign,butalso

The Klipsch Flexus Core 300 is the top model in the series and is positioned above the already available Flexus Core 200 in the company's soundbar line-up. According to Klipsch, this is the first soundbar in the world whose sound can be adapted to th

jQuery is a popular JavaScript library used to simplify client-side development. AJAX is a technology that sends asynchronous requests and interacts with the server without reloading the entire web page. However, when using jQuery to make AJAX requests, you sometimes encounter 403 errors. 403 errors are usually server-denied access errors, possibly due to security policy or permission issues. In this article, we will discuss how to resolve jQueryAJAX request encountering 403 error

Build an autocomplete suggestion engine using PHP and Ajax: Server-side script: handles Ajax requests and returns suggestions (autocomplete.php). Client script: Send Ajax request and display suggestions (autocomplete.js). Practical case: Include script in HTML page and specify search-input element identifier.

WhiletheLightPhone2from2018wasstillequippedwithaneconomicale-inkdisplay,theLightPhone3usesanOLEDdisplaythatcanonlydisplaygrayscale.Thereasonfortheswitchtothe3.92-inchOLEDpanelwithitsresolutionof1,240x1,080isth

How to solve the problem of jQueryAJAX error 403? When developing web applications, jQuery is often used to send asynchronous requests. However, sometimes you may encounter error code 403 when using jQueryAJAX, indicating that access is forbidden by the server. This is usually caused by server-side security settings, but there are ways to work around it. This article will introduce how to solve the problem of jQueryAJAX error 403 and provide specific code examples. 1. to make
