js指定路径问题

archimove 2004-11-03 09:05:11
我使用了一个控间,它的js中指定了图片的位置,我在不同目录下面的页面使用控间,图片的位置就不正确,请教大虾:
js中定义如下:
var imgDir=/Picture/DatePicker/
...全文
61 2 打赏 收藏 举报
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
archimove 2004-11-03
  • 打赏
  • 举报
回复
ok了,不过是这样的:
var imgDirpath= window.location.href
window.alert(imgDirpath);
var imgDir=imgDirpath.substring(0,imgDirpath.indexOf('/',imgDirpath.indexOf('/',imgDirpath.indexOf('//')+2)+1))+"/Picture/DatePicker/"
window.alert(imgDir);

thx,for ur re.
cuixiping 2004-11-03
  • 打赏
  • 举报
回复
var imgDir="/Picture/DatePicker/";
相关推荐
output: { filename: "[name].js", path:path.resolve(__dirname,"build") }如果没有指定pubicPath,则引入路径如下 <script src="b.js"> window.__INITIAL_STATE__= {"csrf":"dy7RUzgs-morKt_ckaL55RZEZJzycvPVAV8o","origin":"http:\u002F\u002Fbbs.csdn.net","isMobile":false,"cookie":"uuid_tt_dd=10_3156167960-1675141677638-150977;","ip":"18.207.238.28","pageData":{"page":{"pageId":143,"title":"社区详情","keywords":"社区详情","description":"社区详情","ext":{"isMd":"true","armsfe1":"{pid:\"dyiaei5ihw@1a348e4d05c2c78\",appType:\"web\",imgUrl:\"https:\u002F\u002Farms-retcode.aliyuncs.com\u002Fr.png?\",sendResource:true,enableLinkTrace:true,behavior:true}","redPacketCfg":"{\"defaultTitle\":\"新春大吉!\",\"preOpenSty\":{},\"redCardSty\":{}}","blogStar":"[{\"year\":\"2021\",\"enable\":true,\"communityIds\":[3859],\"url\":\"https:\u002F\u002Fbbs.csdn.net\u002Fsummary2021\"},{\"year\":\"2022\",\"enable\":true,\"communityIds\":[3860],\"url\":\"https:\u002F\u002Fbbs.csdn.net\u002Fsummary2022\"}]","mdVersion":"https:\u002F\u002Fcsdnimg.cn\u002Frelease\u002Fmarkdown-editor\u002F1.1.0\u002Fmarkdown-editor.js","componentSortCfg":"{ \"right\":[\"ratesInfo\",\"cty-profile\",\"pub-comp\",\"user-right-introduce\",\"post-event\",\"my-mission\",\"user-recommend\",\"user-right-rank\",\"user-right-rule\",\"user-right-adimg\"] }","show_1024":"{\"enable\":false,\"useWhitelist\":false,\"whitelist\":[76215],\"home\":\"https:\u002F\u002F1111.csdn.net\u002F\",\"logo\":\"https:\u002F\u002Fimg-home.csdnimg.cn\u002Fimages\u002F20221104102741.png\",\"hideLive\":true}","iframes":"[\"3859\"]","pageCfg":"{\"disableDownloadPDF\": false,\"hideSponsor\":false}"}},"template":{"templateId":71,"templateComponentName":"ccloud-detail","title":"ccloud-detail","floorList":[{"floorId":562,"floorComponentName":"floor-user-content","title":"社区详情页","description":"社区详情页","indexOrder":3,"componentList":[{"componentName":"baseInfo","componentDataId":"cloud-detail1","componentConfigData":{},"relationType":3},{"componentName":"user-right-introduce","componentDataId":"","componentConfigData":{},"relationType":2},{"componentName":"user-recommend","componentDataId":"","componentConfigData":{},"relationType":2},{"componentName":"user-right-rank","componentDataId":"","componentConfigData":{},"relationType":2},{"componentName":"user-right-rule","componentDataId":"","componentConfigData":{},"relationType":2},{"componentName":"user-right-adimg","componentDataId":"","componentConfigData":{},"relationType":2},{"componentName":"default2014LiveRoom","componentDataId":"20221024DefaultLiveRoom","componentConfigData":{},"relationType":3}]}]},"data":{"baseInfo":{"customDomain":"","uriName":"JavaScript","communityHomePage":"https:\u002F\u002Fbbs.csdn.net\u002Fforums\u002FJavaScript","owner":{"userName":"community_91","nickName":"JavaScript","avatarUrl":"https:\u002F\u002Fprofile.csdnimg.cn\u002Fb\u002Fc\u002Fc\u002F3_community_91","position":"","companyName":""},"user":{"userRole":3,"userName":null,"nickName":null,"avatarUrl":null,"rank":null,"follow":2,"communityBase":null,"joinCollege":null,"isVIP":null},"community":{"name":"JavaScript","description":"Web 开发 JavaScript","avatarUrl":"https:\u002F\u002Fimg-community.csdnimg.cn\u002Favatar\u002Fca46c476a908476d9927eaee4b0afc10.png?x-oss-process=image\u002Fresize,m_fixed,h_88,w_88","qrCode":"","createTime":"2007-09-28","communityAvatarUrl":"https:\u002F\u002Fprofile.csdnimg.cn\u002Fb\u002Fc\u002Fc\u002F3_community_91","communityNotice":null,"userCount":87615,"contentCount":224655,"followersCount":53338,"communityRule":"","communityId":209,"bgImage":"","hashId":"y3w0yonz","domain":"","uriName":"JavaScript","externalDisplay":1,"adBanner":{"img":"","url":"","adType":0,"adCon":null},"rightBanner":{"img":"","url":"","adType":0,"adCon":null},"tagId":null,"tagName":null,"communityType":1,"communityApplyUrl":"https:\u002F\u002Fmarketing.csdn.net\u002Fquestions\u002FQ2106040308026533763","joinType":0,"visibleType":0,"collapse":0,"topicMoveAble":0,"allowActions":{},"communityOwner":"community_91","tagNameInfo":{"provinceTag":null,"areaTag":null,"technologyTags":null,"customTags":null}},"tabList":[{"tabId":1368,"tabName":"全部","tabUrl":"","tabSwitch":1,"tabType":4,"tabContribute":0,"cardType":0,"indexOrder":-1,"url":"https:\u002F\u002Fbbs.csdn.net\u002Fforums\u002FJavaScript?typeId=1368","iframe":false,"sortType":1},{"tabId":873,"tabName":"问答","tabUrl":"https:\u002F\u002Fask.csdn.net\u002Flist\u002F11\u002Ftag\u002F190","tabSwitch":1,"tabType":0,"tabContribute":0,"indexOrder":0,"iframe":true,"sortType":1},{"tabId":1620032,"tabName":"Ada助手","tabUrl":"","tabSwitch":1,"tabType":1,"tabContribute":1,"cardType":0,"indexOrder":20,"url":"https:\u002F\u002Fbbs.csdn.net\u002Fforums\u002FJavaScript?typeId=1620032","iframe":false,"sortType":1}],"dataResource":{"mediaType":"c_cloud","subResourceType":"8_c_cloud_long_text","showType":"long_text","tabId":0,"communityName":"JavaScript","communityHomePageUrl":"https:\u002F\u002Fbbs.csdn.net\u002Fforums\u002FJavaScript","content":{"id":"60353946","contentId":60353946,"cateId":0,"cateName":null,"url":"https:\u002F\u002Fbbs.csdn.net\u002Ftopics\u002F60353946","shareUrl":"https:\u002F\u002Fbbs.csdn.net\u002Ftopics\u002F60353946","createTime":"2004-11-03 09:05:11","updateTime":"2021-05-28 12:27:05","resourceUsername":"archimove","best":0,"top":0,"text":null,"publishDate":"2004-11-03","lastReplyDate":"2004-11-03","type":"13","nickname":"archimove","avatar":"https:\u002F\u002Fprofile.csdnimg.cn\u002F7\u002FF\u002FD\u002F1_archimove","username":"archimove","commentCount":2,"diggNum":0,"digg":false,"viewCount":61,"hit":false,"resourceSource":6,"status":10,"taskStatus":null,"expired":false,"taskCate":0,"taskAward":0,"taskExpired":null,"checkRedPacket":null,"avgScore":0,"totalScore":0,"insertFirst":false,"likeInfo":null,"topicTitle":"js指定路径问题","description":"我使用了一个控间,它的js中指定了图片的位置,我在不同目录下面的页面使用控间,图片的位置就不正确,请教大虾: js中定义如下: var imgDir=\u002FPicture\u002FDatePicker\u002F","coverImg":null,"content":"我使用了一个控间,它的js中指定了图片的位置,我在不同目录下面的页面使用控间,图片的位置就不正确,请教大虾:\u003Cbr \u002F\u003E\njs中定义如下:\u003Cbr \u002F\u003E\nvar imgDir=\u002FPicture\u002FDatePicker\u002F","mdContent":null,"pictures":null,"videoInfo":null,"linkInfo":null,"student":{"isCertification":false,"org":"","bala":""},"employee":{"isCertification":false,"org":"","bala":""},"userCertification":[],"dependId":"0","dependSubType":null,"videoUrl":null,"favoriteCount":0,"favoriteStatus":false,"taskType":null,"defaultScore":null,"syncAsk":false,"videoPlayLength":null},"communityUser":null,"allowPost":false,"submitHistory":[{"user":{"registerurl":"https:\u002F\u002Fg.csdnimg.cn\u002Fstatic\u002Fuser-reg-year\u002F1x\u002F18.png","avatarurl":"https:\u002F\u002Fprofile.csdnimg.cn\u002F7\u002FF\u002FD\u002F1_archimove","nickname":"archimove","selfdesc":"","createdate":"2004-10-10 14:41:00","days":"6687","years":"18","username":"archimove","school":null,"company":null,"job":null},"userName":"archimove","event":"创建了帖子","body":"2004-11-03 09:05","editId":null}],"resourceExt":{}},"contentReply":{"pageNo":1,"pageSize":20,"totalPages":1,"totalCount":2,"total":0,"list":[{"hit":null,"hitMsg":null,"content":"ok了,不过是这样的:\u003Cbr \u002F\u003E\nvar imgDirpath= window.location.href\u003Cbr \u002F\u003E\nwindow.alert(imgDirpath);\u003Cbr \u002F\u003E\nvar imgDir=imgDirpath.substring(0,imgDirpath.indexOf('\u002F',imgDirpath.indexOf('\u002F',imgDirpath.indexOf('\u002F\u002F')+2)+1))+"\u002FPicture\u002FDatePicker\u002F"\u003Cbr \u002F\u003E\nwindow.alert(imgDir);\u003Cbr \u002F\u003E\n\u003Cbr \u002F\u003E\nthx,for ur re.","topicTitle":null,"description":"ok了,不过是这样的: var imgDirpath= window.location.href window.alert(imgDirpath); var imgDir=imgDirpath.substring(0,imgDirpath.indexOf('\u002F',imgDirpath.indexOf('\u002F',imgDirpath.indexOf('\u002F\u002F')+2)+1))+\"\u002FPicture\u002FDatePicker\u002F\" window.alert(imgDir); thx,for ur re.","id":43541822,"contentResourceId":60353946,"bindContentResourceId":0,"communityId":209,"username":"archimove","userNickName":"archimove","userAvatar":"https:\u002F\u002Fprofile.csdnimg.cn\u002F7\u002FF\u002FD\u002F1_archimove","mdContent":null,"parentId":0,"replyName":"","replyNickName":"","bizNo":"bbs","ip":3659112805,"status":10,"childCount":0,"topStatus":0,"recommendStatus":0,"userLike":false,"diggCount":0,"childIds":"","createTime":"2004-11-03 10:03:48","updateTime":"2004-11-03 10:03:48","formatTime":"2004-11-03","userRoleHonorary":{"userName":null,"roleId":null,"roleType":null,"roleStatus":null,"honoraryId":null,"roleName":null,"honoraryName":null,"communityNickname":null,"communitySignature":null},"child":null,"communityNickname":null,"communityReplyNickname":null,"rewardInfo":null,"checkRedPacketVO":null,"noDiggCount":null},{"hit":null,"hitMsg":null,"content":"var imgDir="\u002FPicture\u002FDatePicker\u002F";","topicTitle":null,"description":"var imgDir=\"\u002FPicture\u002FDatePicker\u002F\";","id":43540635,"contentResourceId":60353946,"bindContentResourceId":0,"communityId":209,"username":"cuixiping","userNickName":"cuixiping","userAvatar":"https:\u002F\u002Fprofile.csdnimg.cn\u002F1\u002FE\u002F4\u002F1_cuixiping","mdContent":null,"parentId":0,"replyName":"","replyNickName":"","bizNo":"bbs","ip":3701508822,"status":10,"childCount":0,"topStatus":0,"recommendStatus":0,"userLike":false,"diggCount":0,"childIds":"","createTime":"2004-11-03 09:37:55","updateTime":"2004-11-03 09:37:55","formatTime":"2004-11-03","userRoleHonorary":{"userName":"cuixiping","roleId":214,"roleType":0,"roleStatus":1,"honoraryId":0,"roleName":"","honoraryName":null,"communityNickname":"","communitySignature":""},"child":null,"communityNickname":null,"communityReplyNickname":null,"rewardInfo":null,"checkRedPacketVO":null,"noDiggCount":null}],"maxPageSize":3000},"defaultActiveTab":1368,"recommends":[{"url":"https:\u002F\u002Fdownload.csdn.net\u002Fdownload\u002FLike_Bamboo\u002F59604109","title":"JavaScript应用实例-调用相机并保存至\u003Cem\u003E指定\u003C\u002Fem\u003E\u003Cem\u003E路径\u003C\u002Fem\u003E(1).\u003Cem\u003Ejs\u003C\u002Fem\u003E","desc":"JavaScript应用实例-调用相机并保存至\u003Cem\u003E指定\u003C\u002Fem\u003E\u003Cem\u003E路径\u003C\u002Fem\u003E(1).\u003Cem\u003Ejs\u003C\u002Fem\u003E","createTime":"2021-12-09 19:00:03","dataReportQuery":"spm=1035.2023.3001.6557&utm_medium=distribute.pc_relevant_bbs_down_v2.none-task-download-2~default~ESQUERY~Paid-1-59604109-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew&depth_1-utm_source=distribute.pc_relevant_bbs_down_v2.none-task-download-2~default~ESQUERY~Paid-1-59604109-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew","dataReportClick":"{\"mod\":\"popu_645\",\"index\":\"1\",\"dest\":\"https:\u002F\u002Fdownload.csdn.net\u002Fdownload\u002FLike_Bamboo\u002F59604109\",\"strategy\":\"2~default~ESQUERY~Paid\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-download-2~default~ESQUERY~Paid-1-59604109-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","dataReportView":"{\"mod\":\"popu_645\",\"index\":\"1\",\"dest\":\"https:\u002F\u002Fdownload.csdn.net\u002Fdownload\u002FLike_Bamboo\u002F59604109\",\"strategy\":\"2~default~ESQUERY~Paid\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-download-2~default~ESQUERY~Paid-1-59604109-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","type":"download"},{"url":"https:\u002F\u002Fblog.csdn.net\u002Fweixin_44198965\u002Farticle\u002Fdetails\u002F127800022","title":"JavaScript - 去掉(删除)URL \u003Cem\u003E路径\u003C\u002Fem\u003E上\u003Cem\u003E指定\u003C\u002Fem\u003E的参数(传递一个 URL 和要删除的参数名,返回结果)","desc":"\u003Cem\u003Ejs\u003C\u002Fem\u003E 去掉URL\u003Cem\u003E路径\u003C\u002Fem\u003E上\u003Cem\u003E指定\u003C\u002Fem\u003E参数,\u003Cem\u003Ejs\u003C\u002Fem\u003E删除url\u003Cem\u003E指定\u003C\u002Fem\u003E参数,\u003Cem\u003Ejs\u003C\u002Fem\u003E删除url\u003Cem\u003E指定\u003C\u002Fem\u003E参数,关于使用\u003Cem\u003EJS\u003C\u002Fem\u003E去除URL中的\u003Cem\u003E指定\u003C\u002Fem\u003E参数\u003Cem\u003E问题\u003C\u002Fem\u003E,\u003Cem\u003Ejs\u003C\u002Fem\u003E 对url进行某个参数,关于使用\u003Cem\u003EJS\u003C\u002Fem\u003E去除URL中的\u003Cem\u003E指定\u003C\u002Fem\u003E参数\u003Cem\u003E问题\u003C\u002Fem\u003E,\u003Cem\u003Ejs\u003C\u002Fem\u003E 对url进行某个参数,最简单的方法:\u003Cem\u003EJS\u003C\u002Fem\u003E去除url中某个参数,\u003Cem\u003EJS\u003C\u002Fem\u003E 去掉浏览器中 url 参数,\u003Cem\u003Ejs\u003C\u002Fem\u003E删除url中的某个参数_\u003Cem\u003Ejs\u003C\u002Fem\u003E删除url参数_\u003Cem\u003Ejs\u003C\u002Fem\u003E获取url的某个参,关于使用\u003Cem\u003EJS\u003C\u002Fem\u003E去除URL中的\u003Cem\u003E指定\u003C\u002Fem\u003E参数\u003Cem\u003E问题\u003C\u002Fem\u003E,\u003Cem\u003Ejs\u003C\u002Fem\u003E 对url进行某个参数,\u003Cem\u003Ejs\u003C\u002Fem\u003E获取链接去掉参数,\u003Cem\u003EJS\u003C\u002Fem\u003E 获取url中的参数 修改url 参数 移除url参数,","createTime":"2022-11-11 09:22:12","dataReportQuery":"spm=1035.2023.3001.6557&utm_medium=distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-2-127800022-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew&depth_1-utm_source=distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-2-127800022-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew","dataReportClick":"{\"mod\":\"popu_645\",\"index\":\"2\",\"dest\":\"https:\u002F\u002Fblog.csdn.net\u002Fweixin_44198965\u002Farticle\u002Fdetails\u002F127800022\",\"strategy\":\"2~default~ESQUERY~Rate\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-2-127800022-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","dataReportView":"{\"mod\":\"popu_645\",\"index\":\"2\",\"dest\":\"https:\u002F\u002Fblog.csdn.net\u002Fweixin_44198965\u002Farticle\u002Fdetails\u002F127800022\",\"strategy\":\"2~default~ESQUERY~Rate\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-2-127800022-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","type":"blog"},{"url":"https:\u002F\u002Fblog.csdn.net\u002FmcYang0929\u002Farticle\u002Fdetails\u002F79918242","title":"webpack之publicPath\u003Cem\u003E路径\u003C\u002Fem\u003E\u003Cem\u003E问题\u003C\u002Fem\u003E","desc":"output: {\n filename: \"[name].\u003Cem\u003Ejs\u003C\u002Fem\u003E\",\n path:path.resolve(__dirname,\"build\")\n}如果没有\u003Cem\u003E指定\u003C\u002Fem\u003EpubicPath,则引入\u003Cem\u003E路径\u003C\u002Fem\u003E如下\u003Cbody\u003E\n \u003Cscript src=\"b.\u003Cem\u003Ejs\u003C\u002Fem\u003E\"\u003E\u003C\u002Fscript\u003E\n\u003C\u002Fbody\u003E如果有\u003Cem\u003E指定\u003C\u002Fem\u003EpublicPathoutput: {\n filename: \"[name].\u003Cem\u003Ejs\u003C\u002Fem\u003E\",","createTime":"2018-04-12 18:45:44","dataReportQuery":"spm=1035.2023.3001.6557&utm_medium=distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-3-79918242-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew&depth_1-utm_source=distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-3-79918242-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew","dataReportClick":"{\"mod\":\"popu_645\",\"index\":\"3\",\"dest\":\"https:\u002F\u002Fblog.csdn.net\u002FmcYang0929\u002Farticle\u002Fdetails\u002F79918242\",\"strategy\":\"2~default~ESQUERY~Rate\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-3-79918242-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","dataReportView":"{\"mod\":\"popu_645\",\"index\":\"3\",\"dest\":\"https:\u002F\u002Fblog.csdn.net\u002FmcYang0929\u002Farticle\u002Fdetails\u002F79918242\",\"strategy\":\"2~default~ESQUERY~Rate\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-3-79918242-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","type":"blog"},{"url":"https:\u002F\u002Fblog.csdn.net\u002Fweixin_35645230\u002Farticle\u002Fdetails\u002F117798746","title":"html页面保存到本地文件\u003Cem\u003E路径\u003C\u002Fem\u003E,\u003Cem\u003Ejs\u003C\u002Fem\u003E上传文件到\u003Cem\u003E指定\u003C\u002Fem\u003E\u003Cem\u003E路径\u003C\u002Fem\u003E jQuery或者\u003Cem\u003Ejs\u003C\u002Fem\u003E保存文件到本地...","desc":"\u003Cem\u003Ejs\u003C\u002Fem\u003E怎么传递一个上传文件的\u003Cem\u003E路径\u003C\u002Fem\u003Ejquery或者\u003Cem\u003Ejs\u003C\u002Fem\u003E获取上传文件的\u003Cem\u003E路径\u003C\u002Fem\u003E\u003Cem\u003E问题\u003C\u002Fem\u003E现有一表单,里面有一项是上传图片,思路是:点击提交(button)后,通我的理解是你应该先通过图片上传接口把图片上传到服务器上(上传后的服务器端的图片地址,保存到里),然后再统一提交所有的表单项。\u003Cem\u003Ejs\u003C\u002Fem\u003E中如何将某地址的图片保存到本地\u003Cem\u003E指定\u003C\u002Fem\u003E文件夹中?用\u003Cem\u003EJS\u003C\u002Fem\u003EPSMA处理,参考下面代码实现:用\u003Cem\u003Ejs\u003C\u002Fem\u003E如何实现点击按钮打开一个\u003Cem\u003E指定\u003C\u002Fem\u003E\u003Cem\u003E路径\u003C\u002Fem\u003E下的文件...","createTime":"2021-06-11 04:05:10","dataReportQuery":"spm=1035.2023.3001.6557&utm_medium=distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-4-117798746-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew&depth_1-utm_source=distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-4-117798746-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew","dataReportClick":"{\"mod\":\"popu_645\",\"index\":\"4\",\"dest\":\"https:\u002F\u002Fblog.csdn.net\u002Fweixin_35645230\u002Farticle\u002Fdetails\u002F117798746\",\"strategy\":\"2~default~ESQUERY~Rate\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-4-117798746-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","dataReportView":"{\"mod\":\"popu_645\",\"index\":\"4\",\"dest\":\"https:\u002F\u002Fblog.csdn.net\u002Fweixin_35645230\u002Farticle\u002Fdetails\u002F117798746\",\"strategy\":\"2~default~ESQUERY~Rate\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-4-117798746-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","type":"blog"},{"url":"https:\u002F\u002Fblog.csdn.net\u002Fweixin_43939924\u002Farticle\u002Fdetails\u002F116231542","title":"Thymeleaf\u003Cem\u003E指定\u003C\u002Fem\u003E@{} BaseUrl \u003Cem\u003E路径\u003C\u002Fem\u003E","desc":"Thymeleaf\u003Cem\u003E指定\u003C\u002Fem\u003E@{} BaseUrl \u003Cem\u003E路径\u003C\u002Fem\u003E\n\u003Cem\u003E问题\u003C\u002Fem\u003E:\n前端请求后端的域名加了一个 路由 前端的一些\u003Cem\u003Ejs\u003C\u002Fem\u003E 和图片找不到了\n\n\n\n修改方法:\npackage cn.decentchina.kentucky.api.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.thymeleaf.Temp","createTime":"2021-04-28 13:27:46","dataReportQuery":"spm=1035.2023.3001.6557&utm_medium=distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-5-116231542-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew&depth_1-utm_source=distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-5-116231542-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew","dataReportClick":"{\"mod\":\"popu_645\",\"index\":\"5\",\"dest\":\"https:\u002F\u002Fblog.csdn.net\u002Fweixin_43939924\u002Farticle\u002Fdetails\u002F116231542\",\"strategy\":\"2~default~ESQUERY~Rate\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-5-116231542-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","dataReportView":"{\"mod\":\"popu_645\",\"index\":\"5\",\"dest\":\"https:\u002F\u002Fblog.csdn.net\u002Fweixin_43939924\u002Farticle\u002Fdetails\u002F116231542\",\"strategy\":\"2~default~ESQUERY~Rate\",\"extra\":\"{\\\"utm_medium\\\":\\\"distribute.pc_relevant_bbs_down_v2.none-task-blog-2~default~ESQUERY~Rate-5-116231542-bbs-60353946.pc_relevant_bbs_down_v2_opensearchbbsnew\\\",\\\"dist_request_id\\\":\\\"1675141673740_62301\\\"}\",\"spm\":\"1035.2023.3001.6557\"}","type":"blog"}],"staffDOList":[{"id":null,"communityId":209,"username":"community_91","userNickname":"JavaScript","roleCode":1,"status":1,"createUsername":"","updateUsername":"","avatarUrl":"https:\u002F\u002Fprofile.csdnimg.cn\u002FB\u002FC\u002FC\u002F1_community_91","createTime":"2021-05-12 18:07:03","updateTime":"2021-05-12 18:07:03","lastLoginTime":"2021-05-12 18:07:03"},{"id":null,"communityId":209,"username":"sysdzw","userNickname":"无·法","roleCode":2,"status":1,"createUsername":"community_91","updateUsername":"","avatarUrl":"https:\u002F\u002Fprofile.csdnimg.cn\u002F2\u002FA\u002F6\u002F1_sysdzw","createTime":"2021-06-16 17:59:42","updateTime":"2021-06-16 17:59:42","lastLoginTime":"2021-06-16 17:59:42"}],"communityConfig":{"scoreType":0,"scoreItems":{"0":"给本帖投票","1":"锋芒小试,眼前一亮","2":"潜力巨大,未来可期","3":"持续贡献,值得关注","4":"成绩优异,大力学习","5":"贡献巨大,全力支持"}},"shouldApply":false,"subscribeAble":false},"default2014LiveRoom":[{"itemType":"","description":"高峰论坛","title":"2022 技术英雄会","url":"https:\u002F\u002Flive.csdn.net\u002Froom\u002Fiframe\u002Fcsdnnews\u002FfsNR5NWp?chat=1&title=1&footer=1","images":["https:\u002F\u002Fimg-home.csdnimg.cn\u002Fimages\u002F20221016050009.png"],"ext":{"time":"9:00","liveRoomUrl":"https:\u002F\u002Flive.csdn.net\u002Froom\u002Fcsdnnews\u002FfsNR5NWp"}}]},"isGooglebot":false,"canonical":"https:\u002F\u002Fwww.csdn.net\u002Ftopics\u002F60353946","openUrl":"","isApp":false,"localUrl":"http:\u002F\u002Fbbs.csdn.net\u002Fccloud\u002Ftopics\u002F60353946","typeId":"index","hasIndex":false},"CFG":{"ALIPLAYER_VERSION":"v4","ALIPLAYER_H5_VERSION":"mobile_v1","ENV":"prod","ROOT_URL":"https:\u002F\u002Fcms-mall.csdn.net\u002F","VUE_APP_API_URL_SERVER":"http:\u002F\u002Fcms-community-api.internal.csdn.net\u002F","VUE_APP_API_URL":"https:\u002F\u002Fcms-api.csdn.net\u002F","LOGIN_URL":"https:\u002F\u002Fpassport.csdn.net\u002Faccount\u002Flogin","VUE_APP_DOMAIN_SKILL":"https:\u002F\u002Fedu.csdn.net\u002F","VUE_APP_DOMAIN_PATH":"https:\u002F\u002Fedu.csdn.net\u002F","VUE_APP_COMMUNITY_API_URL":"https:\u002F\u002Fcommunity-api.csdn.net\u002F","VUE_APP_CCLOUD_API_URL":"https:\u002F\u002Fbizapi.csdn.net\u002Fcommunity-cloud\u002Fv1\u002F","VUE_APP_SKILL_API_URL":"https:\u002F\u002Fbizapi.csdn.net\u002Fskilltree\u002Fapi\u002F","VUE_APP_SEARCH_PLUGIN_API_URL":"https:\u002F\u002Fbizapi.csdn.net\u002Fsearchplugin\u002F","VUE_APP_COMMUNITY_ASK_API_URL":"https:\u002F\u002Fmp-ask.csdn.net\u002F","VUE_APP_ME_URL":"https:\u002F\u002Fme.csdn.net\u002F","VUE_APP_CCLOUD_RESUME":"https:\u002F\u002Fbizapi.csdn.net\u002Fjob-api\u002F","VUE_APP_CCLOUD_MAIN":"https:\u002F\u002Fwww.csdn.net\u002F","VUE_APP_CCLOUD_UC":"https:\u002F\u002Fwww.csdn.net\u002F","VUE_APP_CCLOUD_BZP_API_URL":"https:\u002F\u002Fbizapi.csdn.net\u002F","VUE_APP_CCLOUD_START_API_URL":"https:\u002F\u002Fmp-action.csdn.net\u002F","VUE_APP_PRACTIVE":"https:\u002F\u002Fbizapi.csdn.net\u002Fdaily-practice\u002F","VUE_APP_CCLOUD_HOSTPATH":"https:\u002F\u002Fbbs.csdn.net\u002F"},"queries":{"pageId":[],"domain":["ccloud.csdn.net\u002Fccloud\u002Fdetail1"],"id":["60353946"],"deviceType":"pc","isSpider":"","hostname":["bbs.csdn.net"]},"basePath":"bbs.csdn.net\u002Fccloud\u002Ftopics\u002F60353946","hrefUrl":"http:\u002F\u002Fbbs.csdn.net\u002Ftopics\u002F60353946","active":0,"navBarFixed":false,"title":"js指定路径问题","isLive":false,"contentType":{"text":"text","picture":"picture","link":"link","video":"video","vote":"vote","live":"live","blog":"blog","long_text":"long_text","task_text":"task_text"},"liveUrl":"https:\u002F\u002Flive.csdn.net\u002Froom\u002Fiframe\u002F","spmExtra":{"id":209,"topicId":60353946},"keywords":"","description":"以下内容是CSDN社区关于js指定路径问题相关内容,如果想了解更多关于JavaScript社区其他内容,请访问CSDN社区。"};如果有指定publicPathoutput: { filename: "[name].js",
发帖
JavaScript

8.7w+

社区成员

Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
帖子事件
创建了帖子
2004-11-03 09:05
社区公告
暂无公告