我有一个简单的React JS项目,我正在部署到OSE中.我也在我的项目中使用以下依赖项.
"webpack": "^2.2.0",
"webpack-dev-server": "^1.14.1",
"react": "^15.5.4",
"react-router-dom": "^4.1.1"
Run Code Online (Sandbox Code Playgroud)
我也通过下面的构建脚本运行我的项目.
"build": "SET NODE_ENV=production && webpack-dev-server --host 0.0.0.0 --inline --history-api-fallback --content-base . "
Run Code Online (Sandbox Code Playgroud)
在OSE中一切顺利,Webpack成功编译.但在访问网址时,它会在网页上显示"无效的主机标头".
任何人都可以帮忙.React中有些新东西.
提前致谢.
我正在做一个ajax调用,在success函数中我正在使用JSON.Parsefunction.But问题是JSON.parse除了在iPad-Safari浏览器(iPad版~7.0.6)之外,函数在任何地方都有效.在iPad Safari中,我的代码在我使用的行之后JSON.Parse似乎没有执行.我尝试alert了一些消息,JSON.Parse但没有运气.我们能找到解决这个问题的方法吗?
提前致谢.
这是我正在运行的SCRIPT:
var obj = JSON.parse($('#divWOListForFE').html());
alert('hello'); //this alert doesnt execute on iPadSafari
$('#divWOListForFE').html('');
BindWorkOrderGrid(obj, 1, 10);
Run Code Online (Sandbox Code Playgroud)
的值的 $('#divWOListForFE').html()是下面
"[{"Pk_WorkOrderId":6806,"Fk_CompanyId":null,"Fk_CreatedByUserId":null,"Fk_ProposalId":null,"Fk_InvoiceId":null,"OrderNo":242,"Fk_SiteAddressId":null,"Fk_CustomerId":null,"Fk_GanttItemId":null,"AppointmentDateTime":null,"TimestampCreated":null,"CreationDate":null,"TimestampModified":null,"Description":"","EquipmentNeeded":null,"SpecialInstructions":null,"WorkOrderType":"Contract","JobType":null,"HourlyRate":null,"CompletionStatus":null,"TotalEstHrs":null,"TotalActualHrs":null,"WorkToBePerformed":null,"BIllingStatus":null,"OkToBill":null,"WorkOrderStatus":"Scheduled","IsDeleted":false,"IsProposalSort":null,"TotalRecords":6,"IsUserCreator":1,"CreatedBy":"Mndi,Murali","CustomerName":"Mfsi - Mindi M1","StartTime":"10/1/2014 8:00:00 AM"},{"Pk_WorkOrderId":6807,"Fk_CompanyId":null,"Fk_CreatedByUserId":null,"Fk_ProposalId":null,"Fk_InvoiceId":null,"OrderNo":243,"Fk_SiteAddressId":null,"Fk_CustomerId":null,"Fk_GanttItemId":null,"AppointmentDateTime":null,"TimestampCreated":null,"CreationDate":null,"TimestampModified":null,"Description":"","EquipmentNeeded":null,"SpecialInstructions":null,"WorkOrderType":"Contract","JobType":null,"HourlyRate":null,"CompletionStatus":null,"TotalEstHrs":null,"TotalActualHrs":null,"WorkToBePerformed":null,"BIllingStatus":null,"OkToBill":null,"WorkOrderStatus":"Scheduled","IsDeleted":false,"IsProposalSort":null,"TotalRecords":6,"IsUserCreator":1,"CreatedBy":"Mndi,Murali","CustomerName":"Mfsi - Murli Mindi","StartTime":"8/1/2014 8:00:00 AM"},{"Pk_WorkOrderId":6808,"Fk_CompanyId":null,"Fk_CreatedByUserId":null,"Fk_ProposalId":null,"Fk_InvoiceId":null,"OrderNo":244,"Fk_SiteAddressId":null,"Fk_CustomerId":null,"Fk_GanttItemId":null,"AppointmentDateTime":null,"TimestampCreated":null,"CreationDate":null,"TimestampModified":null,"Description":"adding a new description for this field user.","EquipmentNeeded":null,"SpecialInstructions":null,"WorkOrderType":"Contract","JobType":null,"HourlyRate":null,"CompletionStatus":null,"TotalEstHrs":null,"TotalActualHrs":null,"WorkToBePerformed":null,"BIllingStatus":null,"OkToBill":null,"WorkOrderStatus":"Scheduled","IsDeleted":false,"IsProposalSort":null,"TotalRecords":6,"IsUserCreator":1,"CreatedBy":"Mndi,Murali","CustomerName":"Mindi, Shiv","StartTime":"10/2/2014 8:00:00 AM"},{"Pk_WorkOrderId":6808,"Fk_CompanyId":null,"Fk_CreatedByUserId":null,"Fk_ProposalId":null,"Fk_InvoiceId":null,"OrderNo":244,"Fk_SiteAddressId":null,"Fk_CustomerId":null,"Fk_GanttItemId":null,"AppointmentDateTime":null,"TimestampCreated":null,"CreationDate":null,"TimestampModified":null,"Description":"adding a new description for this field user.","EquipmentNeeded":null,"SpecialInstructions":null,"WorkOrderType":"Contract","JobType":null,"HourlyRate":null,"CompletionStatus":null,"TotalEstHrs":null,"TotalActualHrs":null,"WorkToBePerformed":null,"BIllingStatus":null,"OkToBill":null,"WorkOrderStatus":"Scheduled","IsDeleted":false,"IsProposalSort":null,"TotalRecords":6,"IsUserCreator":1,"CreatedBy":"Mndi,Murali","CustomerName":"Mindi, Shiv","StartTime":"10/2/2014 8:00:00 AM"},{"Pk_WorkOrderId":6809,"Fk_CompanyId":null,"Fk_CreatedByUserId":null,"Fk_ProposalId":null,"Fk_InvoiceId":null,"OrderNo":245,"Fk_SiteAddressId":null,"Fk_CustomerId":null,"Fk_GanttItemId":null,"AppointmentDateTime":null,"TimestampCreated":null,"CreationDate":null,"TimestampModified":null,"Description":"","EquipmentNeeded":null,"SpecialInstructions":null,"WorkOrderType":"Contract","JobType":null,"HourlyRate":null,"CompletionStatus":null,"TotalEstHrs":null,"TotalActualHrs":null,"WorkToBePerformed":null,"BIllingStatus":null,"OkToBill":null,"WorkOrderStatus":"Scheduled","IsDeleted":false,"IsProposalSort":null,"TotalRecords":6,"IsUserCreator":1,"CreatedBy":"Mndi,Murali","CustomerName":"Sudhansu-Dummy test","StartTime":"10/5/2014 1:00:00 PM"},{"Pk_WorkOrderId":6809,"Fk_CompanyId":null,"Fk_CreatedByUserId":null,"Fk_ProposalId":null,"Fk_InvoiceId":null,"OrderNo":245,"Fk_SiteAddressId":null,"Fk_CustomerId":null,"Fk_GanttItemId":null,"AppointmentDateTime":null,"TimestampCreated":null,"CreationDate":null,"TimestampModified":null,"Description":"","EquipmentNeeded":null,"SpecialInstructions":null,"WorkOrderType":"Contract","JobType":null,"HourlyRate":null,"CompletionStatus":null,"TotalEstHrs":null,"TotalActualHrs":null,"WorkToBePerformed":null,"BIllingStatus":null,"OkToBill":null,"WorkOrderStatus":"Scheduled","IsDeleted":false,"IsProposalSort":null,"TotalRecords":6,"IsUserCreator":1,"CreatedBy":"Mndi,Murali","CustomerName":"Sudhansu-Dummy test","StartTime":"10/5/2014 1:00:00 PM"}]"
Run Code Online (Sandbox Code Playgroud) 在使用import语句时,我很难区分sass-loader和css-loader.根据我的知识,css loader解析导入语句(@import),而style-loader适用于在页面上动态注入样式.我也在我的应用程序中使用sass-loader.所以我对sass-loader功能感到困惑.它是否也解析了import语句以及将sass转换为css.在这种情况下,如果我在项目中只使用sass文件,那么我不需要css-loader,因为该工作将由sass-loader完成.我在这儿吗?有谁可以请高亮一点.任何帮助将非常感激
我有一个 html 下拉菜单。在下拉列表中,某些选项的字符串很长,没有任何空格。我想将这些选项包装到下一行。我使用了 CSSword-wrap属性。它在 Chrome 中对我来说很好,但在 Firefox 中不行。
我还尝试word-break按照建议的副本中的建议使用该属性
我还在jsfiddle 上做了一个演示。它在 Chrome 上看起来不错,但是如果您在 Firefox 上打开该演示,则文本无法换行。我怎样才能解决这个问题?
.setWidth {
width: 300px
}Run Code Online (Sandbox Code Playgroud)
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-4">
<select class="formNamesList setWidth" id="CustomCategories" name="CustomCategories" size="15">
<option value="10085240">_1Test_Today</option>
<option value="10085242">_1Test_Today_A</option>
<option value="10085091" style="word-wrap:break-word">testcust_copyFinal_copytetshhshshshhshshhshshshhshshhshshhshshshshhshshshshhshshshshhshshhshs</option>
</select>
</div>Run Code Online (Sandbox Code Playgroud)
webpack ×2
css ×1
css-loader ×1
deployment ×1
html-select ×1
ipad ×1
javascript ×1
jquery ×1
json ×1
php ×1
react-router ×1
reactjs ×1
sass ×1
sass-loader ×1