ECSHOP实验AJAX传值
来源:互联网 发布:沈阳淘宝网店推广 编辑:程序博客网 时间:2024/05/19 04:25
笔者先在ECSHOP首页模板增加了一段标签(flower.php为测试的php页面,相应的模板文件为flower.dwt)
<a href="http://localhost/flower.php">测试页面</a>
在flower.dwt页面写入
<!DOCTYPE html><html><head><meta charset="utf-8" /><title>测试的</title>{insert_scripts files='transport.js'}<script type="text/javascript">function textaaa(){if(document.getElementById('test')){var rec_id=document.getElementById('test').value; Ajax.call('flower.php?act=ajax', 'rec_id=' + rec_id, textres, 'GET','JSON'); }}function textres(result){alert(result.content);}</script></head><body><input type="text" id="test" /><input type="button" onclick="textaaa()"/></body></html>
相应的flower.php页面写入
define('IN_ECTOUCH', true);require(dirname(__FILE__) . '/include/init.php');require(ROOT_PATH . 'include/lib_order.php');require_once(ROOT_PATH .'include/cls_json.php');if ($_REQUEST['act'] == 'ajax') { $keywords = json_str_iconv(trim($_GET['rec_id'])); $keywords= $keywords+1; $json = new JSON; $result = array('error' => 0, 'message' => '', 'content' => $keywords); die($json->encode($result)); }$smarty->display('flower.dwt');
即可
0 0
- ECSHOP实验AJAX传值
- Ajax Get in ecshop
- Ecshop中的Ajax使用方法
- ecshop中ajax.call使用 [ECshop]
- ecshop中ajax.call使用
- ecshop Ajax.call的使用
- ecshop ajax无刷新登陆
- ecshop ajax无刷新登陆
- ecshop ajax内置函数Ajax.call
- ecshop中ajax调用原理-讲座8
- ecshop中ajax的调用原理
- ecshop中ajax的调用原理
- ecshop中ajax的调用原理
- ECSHOP中ajax的调用原理
- ecshop后台通过ajax搜索原理
- ecshop前台使用ajax分页分析
- ecshop中ajax的调用原理
- ECSHOP利用ajax更新购物车数量
- SEM经验-2
- 微信支付的坑
- iOS开发之集成ijkplayer视频直播
- uploadify上传文件学习
- 数据结构图之四(最短路径--迪杰斯特拉算法)
- ECSHOP实验AJAX传值
- 09:移动路线
- ViewPager详解
- linux下调试elf各命令
- Elasticsearch 安装 head 插件
- 如何看执行计划
- Xcode 升级之后安装插件管理工具
- Hadoop学习笔记之HDFS
- mybatis 调用oracle 存储过程并返回结果集