I tried to implement a tree view similar with this( https://iamrohit.in/javascript-css-horizontal-employee-treeview/ ) but the script only work just after first refresh of the page, I'm using angular, is there an option to load the page before so the user doesn't need to refresh the page every time because that's not my intention on this project.
Related
I was trying to make an application in SharePoint and wanted to make it so that if you click on a button, it redirects you to a page and when that page loads I wanted it to instantly redirect the user to another page. ( I couldn't get the button to just redirect to the page I wanted on click, so that's why I tried doing it this way. ) I did this using a jQuery / JavaScript script. I'm new to making scripts so I was just testing and I ended up making this script:
<script type="text/javascript">
$(document).ready(function(){
Redirect();
});
function Redirect(){
$(document).load("url");
}
</script>
My problem is now that whenever that page loads, it just loads a blank page. But I can't get to the edit screen because it instantly redirects me to a blank page. I tried turning off JavaScript in Google Chrome but even though I was able to load the page without redirecting, I wasn't able to get to the edit page because it's in a jQuery AJAX drop down menu which obviously also doesn't work if JavaScript is turned off.
I would appreciate any help
EDIT: When I say edit screen I mean the place where I can edit the script. To do that I have to press a button on the page, but I can't do that since the page instantly redirects to a blank page.
Use the webpart maintenance page which allows you to remove and manage web parts without visiting the page, the instructions are as below.
Lets say your page is example.com/sites/default.aspx add the query string ?contents=1 to the page it will take you to the manage web parts page you can remove the script editor web part from there.
The other way is to use SharePoint designer to remove the web part this will also help you achieve the same result.
Using Django 1.11 with Viewflow-Pro 1.04
This is probably a very simple question, but I've spent hours googling and reading and have come up completely empty.
Each page of my app has various CSS/javascript files that it loads with script and link tags. However, when a user clicks a link and it redirects them to another page, the source isn't refreshed - it is still using the source from the previous page (which is often similar, but not the same).
Refreshing the page fixes it, as it pulls the correct source. But basically I'm having to refresh the page every time I get redirected to a new page.
This has proven hard to debug, since a lot of pages have the same source and so they "seem" to work correctly - but I think it only happens with links. If my view.py redirects users (using return render or similar) then it doesn't happen. It is just if a user clicks a link to jump from one part of my site to another.
Anyone have a clue what it could be? I would include code samples, but it's affecting my entire project - if some specific code would be helpful let me know.
This is an example of what one of my links looks like:
{{ MOC }}
Thanks for any help.
Viewflow uses Django-Material frontend with Turbolinks to manage page scripts.
To adapt your page for Turbolinks ensure that scripts located in the <head> of a document. And 'turbolinks:load' event used to initialize it.
Ex: https://github.com/viewflow/viewflow/blob/master/viewflow/frontend/static/viewflow/js/viewflow.js
Still learning AngularJS. I have a setup where I load a subpage by choosing from a list on the main page. The pick is then stored in a service. Once the subpage loads it fetch that service value and use that info to lookup in another list. Problem is that if I reload the subpage the service resets and the pages gets displayed incorrectly because the service value has been reset as well..
Is there a good way to go around this? - I love code snippets as answer or link to them (easier to understand) :-)
I'm using auto reload when developing, so it becomes quite annoying sometimes.. I have to go back the main page and do a reload and navigate back.
I am using WebdriverIO with Javascript and Mocha to create a UI test framework. For that, I am trying to capture screenshots every time a page loads or a page refreshes. Could someone please tell me if this is possible to do it using WebdriverIO or otherwise?
Relevant details: The pages are NOT loaded using driver.url() all the time. The launching URL is arrived at using driver.url(), and then on all navigation happen by clicking on a link on a page or performing an action that leads to another page load. Please also note that page load happens on other conditions as well, for example, when a "Save" button is clicked the same page loads again (refreshes). I am trying to capture a screenshot every time a page loads or refreshes irrespective of whatever action that might cause it. And that's why I want to abstract out the process at a global level than calling driver.saveScreenShot() in multiple places all over the codebase.
Basically on the home page I have the code snippet generated by Twitter Widget, when I load the page for the first time via url, the feed gets displayed, now I go to other page & come back to home page again, the twitter feed doesnt seem to be displayed.
I dont seem to find the reason behind this, is it something related to a SPA ? because if the load home page via URL it loads but when I navigate back & forth it doesn't display, I just see the a tag Tweets by User
This is the widget code when we create a widget inside Twitter Settings(it's minified, I did format to make it readable)
<script>
!function(d,s,id){
var js,fjs=d.getElementsByTagName(s[0],p=/^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id;
js.src=p+"://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js,fjs);
}
}(document,"script","twitter-wjs");
</script>
as you can see the if(!d.getElementById(id)) this looks for the existence of the element, if it doesnt exist then it'll insert the feed, In my case this element exists but the widget was not rendering somehow when I navigate to some page & come back, so I removed that if statement and everything works perfectly, Only a single widget on the page.
Not the best solution but in future someone faces this problem this is a possible workaround !