x11 Posted January 28, 2022 Share Posted January 28, 2022 При старте приложения в браузере и в логах на сервере получаю ошибку: Quote ext-modern-all.js:20 GET http://localhost:8077/Ext/layout/container/Accordion.js?_dc=1643357290468 net::ERR_ABORTED 404 (Not Found) Подскажите, что я делаю не так? Если убрать загрузку этого файла (на картинке), то ошибки нет http://forums.unigui.com/index.php?/topic/18182-accordion-layout-horizontal/&tab=comments#comment-100382 Я загружаю JS-файл в событии TUniServerModule.UniGUIServerModuleBeforeInit() Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 28, 2022 Share Posted January 28, 2022 13 minutes ago, x11 said: Я загружаю JS-файл в событии TUniServerModule.UniGUIServerModuleBeforeInit() 16 minutes ago, x11 said: Я загружаю JS-файл в событии TUniServerModule.UniGUIServerModuleBeforeInit() Не загружайте там. Quote Link to comment Share on other sites More sharing options...
x11 Posted January 28, 2022 Author Share Posted January 28, 2022 Я догадываюсь, что там не нужно, а как где правильно? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 28, 2022 Share Posted January 28, 2022 2 minutes ago, x11 said: а как где правильно? procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin CustomFiles.Add('files/xx.js'); end; Quote Link to comment Share on other sites More sharing options...
x11 Posted January 28, 2022 Author Share Posted January 28, 2022 Если загружать в событии ModuleCreate, то такая же ошибка. Quote Link to comment Share on other sites More sharing options...
x11 Posted January 28, 2022 Author Share Posted January 28, 2022 так как загружать? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 28, 2022 Share Posted January 28, 2022 У меня работает. Вы пути настраивали? Quote Link to comment Share on other sites More sharing options...
x11 Posted January 28, 2022 Author Share Posted January 28, 2022 Нет, настройки в ServerModule я не трогал. Ничего не менял. И еще, я поискал файл "Accordion.js" в папке, где установлен фреймворк uniGUI и этого файла я не нашел Quote Link to comment Share on other sites More sharing options...
x11 Posted January 28, 2022 Author Share Posted January 28, 2022 12 minutes ago, Sherzod said: Вы пути настраивали? все, как положено, ничего не менял Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 28, 2022 Share Posted January 28, 2022 Какой файл Вы загружаете? Quote Link to comment Share on other sites More sharing options...
x11 Posted January 28, 2022 Author Share Posted January 28, 2022 procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); Var s: string; begin UniGuiApplication.PfmtSettings.ThousandSeparator := ' '; AddIGrowl; s := UniServerModule.FilesFolderURL + cJsURLName + 'HorizontalAccordionUniPanel.js'; CustomFiles.Add(s); end; отладчик показывает путь к файлу в переменной S Quote 'files/js/HorizontalAccordionUniPanel.js' мой файл есть Quote Link to comment Share on other sites More sharing options...
x11 Posted January 28, 2022 Author Share Posted January 28, 2022 3 hours ago, Sherzod said: Не загружайте там. Может вы не обратили внимание на первый скрин в первом сообщении, но напишу на всякий случай, что ошибка только при загрузке мобильной версии. Quote Link to comment Share on other sites More sharing options...
x11 Posted January 28, 2022 Author Share Posted January 28, 2022 В общем, я сделал так: procedure TUniMainModule.LoadScriptCSS; begin if UniMainModule.IsMobilePlatform then begin UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + constMobileCss + '")'); UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + constMobileHideCss + '")');// скрывать элементы end else begin// файлы для десктопной версии UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + constDesktopCss + '")'); UniSession.AddJS('Ext.Loader.loadScript("/files/' + constCssUrlName + constDesktopHideCss + '")');// скрывать элементы UniSession.AddJS('Ext.Loader.loadScript("/files/' + cJsURLName + 'HorizontalAccordionUniPanel.js' + '")'); end; end; procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean); begin LoadScriptCSS; end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.